Answers for "using logger in python"

14

making log files in python

#my youtube channel :- 
#https://www.youtube.com/channel/UC-sfqidn2fKZslHWnm5qe-A/videos
import logging
logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)
logging.debug('This is debug message')
logging.info('This is information message')
logging.warning('This is warning message')
logging.error('This is warning message')
Posted by: Guest on July-12-2021
8

create log in python

logging.basicConfig(filename="logfilename.log", level=logging.INFO)
# Log Creation

logging.info('your text goes here')
logging.error('your text goes here')
logging.debug('your text goes here')
Posted by: Guest on October-28-2020
7

logging.logger

import logging

logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
  
logger.debug("some debugging...")
logger.error("some error...")
Posted by: Guest on December-02-2020
1

python fme logger

logger = fmeobjects.FMELogFile()
logger.logMessageString("{}".format('Error'), fmeobjects.FME_ERROR)
Posted by: Guest on March-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language