#WARNING is defalut level
import logging
logging.warning('Watch out!') # will print a message to the console
logging.info('I told you so') # will not print anything
import logging
logging.basicConfig(level=logging.DEBUG);
logging.warning('Watch out!') # will print
logging.info('I told you so') # will print
import logging
def doSomething():
logging.info('Logging in lib ...');
import lib
import logging
logging.basicConfig(filename='log.txt', level=logging.DEBUG);
lib.doSomething()
logging.warning('Watch out!')
logging.info('I told you so')