Last active
November 14, 2017 09:41
-
-
Save verajosemanuel/25cc3f5dd13948efcc32722fc3eca68c to your computer and use it in GitHub Desktop.
python style logging in #R with #py_logging #logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source('py_logging.R') | |
# Set up logging | |
logger.setup(debugLog = "debug.log", infoLog = "info.log", errorLog = "error.log") | |
# Silence other warning messages | |
options(warn = -1) # -1=ignore, 0=save/print, 1=print, 2=error | |
err_msg <- geterrmessage() | |
logger.error('Error on running some scripts: %s') | |
logger.info('Using my favourite function %s') | |
logger.fatal('System crashed due to: %s') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment