import logging my_logger = logging.getLogger() my_logger.warn('test')