import logging logger = logging.getLogger() logger.warn('str string')