Description Usage Arguments Author(s) See Also Examples
Log the name and the content of an R object given levels of logger
1 2 |
x |
ANY, an R object. |
prefix |
the prefix to log. |
logger |
logging level, one of: NULL, 'INFO', 'DEBUG', 'WARNING', 'ERROR', 'CRITICAL' |
envir |
the |
Xiaobei Zhao
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## log an object
x1 <- 1:6
logme(x1)
## log according to logger levels
bar <- function(x,envir=sys.frame(sys.parent(0))){
for (.logger in get_loglevel()) {
if (is.null(.logger)) .prefix <- 'NULL' else .prefix <- .logger
logme(x,prefix=.prefix,logger=.logger,envir=envir)
}
}
options(logger='DEBUG')
bar(1:6) # print logs of level NULL, INFO and DEBUG
options(logger='ERROR')
bar(1:6) # print logs of level NULL, INFO, DEBUG, WARNING and ERROR
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.