InterviewSolution
Saved Bookmarks
| 1. |
Logging in Python |
||||||||||||||||||
|
Answer» Logging allows us to keep track of some events which occurs when some software runs. It becomes highly important in Software Development, Debugging and Running Softwares. import logging# Create and configues the logger logging.basicConfig(filename="newfile.log", format='%(asctime)s %(message)s', filemode='w') # Creates logging object logg = logging.getLogger() # Sets the level of logging to DEBUG logg.setLevel(logging.DEBUG) # Messages logg.debug("Debug Message") logger.warning("Its a Warning") logger.info("Just an information") Levels of Logging: Described in order of increasing importance
|
|||||||||||||||||||