library('log4r')
logger <- create.logger(logfile = 'debugging.log', level = "WARN")
levellog(logger, 'WARN', 'First warning from our code')
debug(logger, 'Debugging our code')
info(logger, 'Information about our code')
warn(logger, 'Another warning from our code')
error(logger, 'An error from our code')
fatal(logger, "I'm outta here")
Run the code above in your browser using DataLab