Skip to content

Instantly share code, notes, and snippets.

@davidohana
Last active May 24, 2020 14:20
Show Gist options
  • Save davidohana/922be95cd45fceb71ba97d87aa7d762d to your computer and use it in GitHub Desktop.
Save davidohana/922be95cd45fceb71ba97d87aa7d762d to your computer and use it in GitHub Desktop.
logger.info("Hello World")
logger.info("Request from {} handled in {:.3f} ms", socket.gethostname(), 11)
logger.info("Request from {} handled in {:.3f} ms", "127.0.0.1", 33.1)
logger.info("My favorite drinks are {}, {}, {}, {}", "milk", "wine", "tea", "beer")
logger.debug("this is a {} message", logging.getLevelName(logging.DEBUG))
logger.info("this is a {} message", logging.getLevelName(logging.INFO))
logger.warning("this is a {} message", logging.getLevelName(logging.WARNING))
logger.error("this is a {} message", logging.getLevelName(logging.ERROR))
logger.critical("this is a {} message", logging.getLevelName(logging.CRITICAL))
logger.info("Does old-style formatting also work? %s it is, but no colors (yet)", True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment