Description Usage Arguments Details Value Author(s) See Also Examples
The function writeLog
can be used to log outputs and/or running
status of scripts to one connection. To use it one does not
need to run registerLog
first.
1 |
fmt |
Format string to passed on to sprintf |
... |
Parameters passed on to sprintf |
con |
A connection, for instance a file (or its name) or
|
level |
Logging level: each higher level will add one extra space before the message. See examples |
In contrast, doLog
can be used to log on multiple connections that
are registered by registerLog
. Therefore, to register logger(s) with
registerLog
is a prerequisite of calling doLog
. Internally
doLog
calls writeLog
sequentially to make multiple-connection
logging.
Side effect is used.
Jitao David Zhang <jitao_david.zhang@roche.com>
registerLog
to register more than one loggers so that
doLog
can write to them sequentially.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | writeLog("This is the start of a log")
writeLog("Message 1", level=1)
writeLog("Message 1.1", level=2)
writeLog("Message 1.2", level=2)
writeLog("Message 2", level=1)
writeLog("Message 3", level=1)
writeLog("Message 3 (special)", level=4)
writeLog("End of the log");
## log with format
writeLog("This is Message %d", 1)
writeLog("Square of 2 is %2.2f", sqrt(2))
## NA is handled automatically
writeLog("This is a not available value: %s", NA, level=1)
writeLog("This is a NULL value: %s", NULL, level=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.