how to use logger in different modules python code example
Example 1: create log in python
logging.basicConfig(filename="logfilename.log", level=logging.INFO)
logging.info('your text goes here')
logging.error('your text goes here')
logging.debug('your text goes here')
Example 2: from logging import logger
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
logger.debug('Loging %s lewel', 'DEBUG')
logger.info('Loging %s lewel', 'INFO')
logger.warning('Loging %s lewel', 'WARN')
logger.error('Loging %s lewel', 'ERROR')
logger.critical('Loging %s lewel', 'CRITICAL')