Message175248
You can already do this with Python 3.2 (and hence with later Python 3.x):
import logging.config
def my_handler(*args, **kwargs):
h = logging.StreamHandler(*args, **kwargs)
h.terminator = '!\n'
return h
LOGGING = {
'version': 1,
'handlers': {
'console': {
'()': my_handler,
'stream': 'ext://sys.stdout',
}
},
'root': {
'handlers': ['console'],
'level': 'INFO',
}
}
logging.config.dictConfig(LOGGING)
logging.info('Hello')
logging.info('world')
which will print
Hello!
world! |
|
Date |
User |
Action |
Args |
2012-11-09 20:21:57 | vinay.sajip | set | recipients:
+ vinay.sajip, lyapun, nikicat |
2012-11-09 20:21:57 | vinay.sajip | set | messageid: <1352492517.22.0.151292334231.issue16391@psf.upfronthosting.co.za> |
2012-11-09 20:21:57 | vinay.sajip | link | issue16391 messages |
2012-11-09 20:21:56 | vinay.sajip | create | |
|