Skip to content

Instantly share code, notes, and snippets.

@grimen
Created October 24, 2017 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grimen/ebbc6cf45360adba54a5f4db2ab39c39 to your computer and use it in GitHub Desktop.
Save grimen/ebbc6cf45360adba54a5f4db2ab39c39 to your computer and use it in GitHub Desktop.
import coloredlogs, logging
# TODO: find library similar to `debug` in Node/NPM
def debug(name):
logger = logging.getLogger(name)
coloredlogs.install(level='DEBUG', logger=logger)
return logger
if __name__ == "__main__":
log = debug("debug:test")
log.debug("this is a debugging message")
log.info("this is an informational message")
log.warning("this is a warning message")
log.error("this is an error message")
log.critical("this is a critical message")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment