Jordi Puigsegur added the comment:
import logging
import logging.handlers
import yaml
logger = logging.getLogger() # root logger
# Option 1 - OK
##handler = logging.handlers.RotatingFileHandler(filename = "test.log",
maxBytes = 262144, backupCount = 3)
# Option 2 - RotatingFileHandler fails when created through yaml
handler = yaml.load("""
!!python/object/new:logging.handlers.RotatingFileHandler
kwds:
filename: test.log
maxBytes: 262144
backupCount: 3
""")
# Option 3 - FileHandler also fails when created through yaml
##handler = yaml.load("""
##!!python/object/new:logging.FileHandler
## kwds:
## filename: test.log
##""")
logger.addHandler(handler)
logger.warning("test handler")
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15616>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com