Initializes Bunyan Style Error Logging. Set threshold for logging with level parameter. Memory buffer is sized with memlines parameter. Log location is set with logpath and logfile. This function itself writes the first log message. Use bunyanStopLog to end logging.
1 2 | bunyanSetLog(level, logpath, logfile, memlines,
jsonout = FALSE, verbose = FALSE)
|
level |
string, required. 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL' Level threshold required to trigger log write. You can change the level on an existing log. |
logpath |
optional. The log path. When not specified uses getwd. Windows paths must include drive letter. |
logfile |
filename optional. The log file name - no path. |
memlines |
integer optional. Number of lines to cache in memory to retrieve with bunyanTraceback() Set to 0 to disable memory logging. 100 is default. Dump contents of memory buffer wth bunyanBuffer(). Does not resize or change an existing bunyan memory buffer. |
jsonout |
logical. Set to TRUE for bunyanLog to return the JSON formatted log string. This function itself will also return a JSON formatted log initialization INFO message. |
verbose |
logical. Set to TRUE to write logged messages to the console. You can opt to write JSON lines using another log package To do this, disable bunyan's output and memory logs with: bunyanSetLog(level=0, memlines=0, jsonout=TRUE) Then retrieve the JSON formatted bunyan format log msg msg <- bunyanLog.info(msg="This is a log message") to pass to the alternate logging package. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.