md.log {md.log} | R Documentation |
md.log
Description
produces Markdown log files with an optional argument to include the function call inside the Markdown log file.
Usage
md.log(msg, file = "", append = FALSE, sys.info = TRUE,
section="monospace", level="", trace=TRUE, date=FALSE,
time=FALSE, print=FALSE, datetime.fmt="%Y-%m-%d %H:%M:%S")
Arguments
msg |
the text that is to be printed in the log file. By default
|
file |
A connection, or a character string naming the file to
print to. If |
append |
logical. Only used if the argument file is the name
of file (and not a connection). If |
sys.info |
logical. Only used Only used if the argument file is the name
of file (and not a connection). If |
section |
styles the |
level |
is a marker that is printed at the beginning of each
|
trace |
logical. If |
date |
logical. if |
time |
logical. if |
print |
logical. if |
datetime.fmt |
specifies the format of date and time arguments
and by default is |
Author(s)
E. F. Haghish
Institute for Community Medicine
University of Greifswald, Germany
haghish@uni-greifswald.de
and
Institute for Medical Informatics (IMBI)
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
Examples
# --------------------------------------------------------------------
# Testing the md.log package
# ====================================================================
child = function() {
md.log("current function", level="dope!")
}
parent = function(){
md.log("step 2")
child()
}
grandparent = function() {
md.log("step 3")
parent()
}
# The main test function that produces the log and calls the other functions
md.log.test = function() {
require(md.log)
md.log("Initiating a new Markdown log", file="markdown.log")
# starting the logs
md.log("a simple MONOSPACE log")
md.log("Adding a level", level="notice")
md.log("level makes you pay attention to a particular line")
# add a subsection and a paragraph in the log
md.log("This is a subsection", section="subsection")
md.log("This is a text paragraph for detailed explanation...", section="paragraph")
# testing the function call
child()
md.log("so far so good! now let's test a more complex nest")
grandparent()
}
md.log.test()