single logging disable(logging criticalcall unlike print()the logging module makes it easy to switch between showing and hiding log messages log messages are intended for the programmernot the user the user won' care about the contents of some dictionary value you need to see to help with debugginguse log message for something like that for messages that the user will want to seelike file not found or invalid inputplease enter numberyou should use print(call you don' want to deprive the user of useful information after you've disabled log messages logging levels logging levels provide way to categorize your log messages by importance there are five logging levelsdescribed in table - from least to most important messages can be logged at each level using different logging function table - logging levels in python level logging function description debug logging debug(the lowest level used for small details usually you care about these messages only when diagnosing problems info logging info(used to record information on general events in your program or confirm that things are working at their point in the program warning logging warning(used to indicate potential problem that doesn' prevent the program from working but might do so in the future error logging error(used to record an error that caused the program to fail to do something critical logging critical(the highest level used to indicate fatal error that has caused or is about to cause the program to stop running entirely your logging message is passed as string to these functions the logging levels are suggestions ultimatelyit is up to you to decide which category your log message falls into enter the following into the interactive shellimport logging logging basicconfig(level=logging debugformat=%(asctime) %(levelname) %(message) 'logging debug('some debugging details ' : : , debug some debugging details logging info('the logging module is working ' : : , info the logging module is working logging warning('an error message is about to be logged ' : : , warning an error message is about to be logged