Get Logs in Beautiful Way

Vaibhav Mishra
1 min readFeb 28, 2020

We all are using python logging module but sometimes it complicated to identify the particular log. So, I am going to explain another python module which is quite interesting to use in your code. That module name is “logzero”

logging vs logzero

Logging is used by every python developer. The sample uses of logging module is given below.

import logging
logging.warning(‘Warning message from your code.’)
logging.error(‘Error message from your code.’)
logging.critical(‘Critical message from your code.’)

The working of logging and logzero is same but logzero is Pretty formatting, including level-specific colors in the console. For logzero first you have to install logzero module via pip3 install logzero. The sample uses of logzero module is given below.

from logzero import logger
logger.debug(“Debug message from your code.”)
logger.info(“Info message from your code.”)
logger.warning(“Warning message from your code.”)
logger.error(“Error message from your code.”)

--

--

Vaibhav Mishra

I am passionate software developer working in different technologies like Python, ML, Django and JavaScript.