Description Usage Arguments Value
Convenience function that wraps logging initialization steps common to Mazama Science web services:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | result <- try({
Copy and old log files
timestamp <- strftime(lubridate::now(), "
for ( logLevel in c("TRACE","DEBUG","INFO","ERROR") ) {
oldFile <- file.path(logDir,paste0(logLevel,".log"))
newFile <- file.path(logDir,paste0(logLevel,".log.",timestamp))
if ( file.exists(oldFile) ) {
file.rename(oldFile, newFile)
}
}
}, silent=TRUE)
stopOnError(result, "Could not rename old log files.")
result <- try({
# Set up logging
logger.setup(traceLog = file.path(logDir, "TRACE.log"),
debugLog=file.path(logDir, "DEBUG.log"),
infoLog=file.path(logDir, "INFO.log"),
errorLog=file.path(logDir, "ERROR.log"))
}, silent=TRUE)
stopOnError(result, "Could not create log files.")
|
1 | initializeLogging(logDir = NULL)
|
logDir |
directory in which to write log files |
No return value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.