logging in python systems (indeed this is why the default log level is set to warning within the python logging systemif we now look at the following code that obtains the default logger object and then uses several different logger methodswe can see the effect of the log levels on the outputimport logging logger logging getlogger(logger debug('this is to help with debugging'logger info('this is just for information'logger warning('this is warning!'logger error('this should be used with something unexpected'logger critical('something serious'the default log level is set to warningand thus only messages logged at the warning level or above will be printed outthis is warningthis should be used with something unexpected something serious as can be seen from thisthe messages logged at the debug and info level have been ignored howeverthe logger object allows us to change the log level programmatically using the setlevel(methodfor example logger setlevel(logging debugor via the logging basicconfig(level logging debugfunctionboth of these will set the logging level to debug note that the log level must be set before the logger is obtained if we add one of the above approaches to setting the log level to the previous program we will change the amount of log information generatedimport logging logging basicconfig(level=logging debuglogger logging getlogger(logger warning('this is warning!'logger info('this is just for information'logger debug('this is to help with debugging'logger error('this should be used with something unexpected logger critical('something serious'