Custom logging function

zljubisic at gmail.com zljubisic at gmail.com
Thu May 28 01:19:45 EDT 2020


> You create two stream handlers that both log to stderr -- one with 
> basicConfig() and one explicitly in your code. That's probably not what you 
> want.

How can I just add terminator = '\r\n' to the code bellow?
Where should I put it?

import logging

LOG_LEVEL = logging.getLevelName('DEBUG')

logging.basicConfig(level=LOG_LEVEL,
                    format='%(asctime)s %(levelname)s %(name)s %(funcName)-20s %(message)s',
                    datefmt='%d.%m.%Y %H:%M:%S')

logging.info('Main script started')


More information about the Python-list mailing list