Created
October 24, 2017 17:27
-
-
Save grimen/ebbc6cf45360adba54a5f4db2ab39c39 to your computer and use it in GitHub Desktop.
This file contains 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
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