Vinay Sajip added the comment:

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!

----------
nosy: +vinay.sajip

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to