Republicação de kite
import logging import logging.handlers import sys logger = logging.getLogger() logger.setLevel(logging.INFO) stdlog = logging.StreamHandler(sys.stdout) syslog = logging.handlers.SysLogHandler(address=("localhost", 8000)) logger.addHandler(stdlog) logger.addHandler(syslog) print logger.handlersOutput[<logging.StreamHandler object at 0x7f6526a20250>, <logging.handlers.SysLogHandler object at 0x7f6526a20290>]logger.handlers.pop() print logger.handlersOutput[<logging.StreamHandler object at 0x7f6526a20250>]logger.info("This is an info message")OutputThis is an info message
Comentários