formatter

python logging dictConfig custom formatter is not being called

python logging dictConfig custom formatter is not being called Question: i have the following ColoeredFormatter in my Module. But The Formatter does not get called. I expect “hi” on the console, but i get “This is an info of the root logger”. i’ve already deleted all .pyc files, but it did not help. MyModule/__init__.py from …

Total answers: 2

datetime: Round/trim number of digits in microseconds

datetime: Round/trim number of digits in microseconds Question: Currently I am logging stuff and I am using my own formatter with a custom formatTime(): def formatTime(self, _record, _datefmt): t = datetime.datetime.now() return t.strftime(‘%Y-%m-%d %H:%M:%S.%f’) My issue is that the microseconds, %f, are six digits. Is there anyway to spit out less digits, like the first …

Total answers: 11