Message167865
| Author |
jordipf |
| Recipients |
jordipf |
| Date |
2012年08月10日.10:50:31 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1344595832.03.0.687864705467.issue15616@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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") |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年08月10日 10:50:32 | jordipf | set | recipients:
+ jordipf |
| 2012年08月10日 10:50:32 | jordipf | set | messageid: <1344595832.03.0.687864705467.issue15616@psf.upfronthosting.co.za> |
| 2012年08月10日 10:50:31 | jordipf | link | issue15616 messages |
| 2012年08月10日 10:50:31 | jordipf | create |
|