-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default coloredlogs datetime output differs from standard formatter's behavior #16
Comments
use coloredlogs.install(level='DEBUG', fmt='%(asctime)s,%(msecs)d %(name)s %(levelname)s -- %(message)s') |
Hi Alexey and thanks for the feedback. Ever since release 0.1 of coloredlogs, milliseconds have never been a part of the default log format. I do appreciate your point that milliseconds will be shown when But looking at the workaround suggested in this issue and reading through this StackOverflow discussion I find the workaround to be rather involved, which really shouldn't be necessary (it should be easier). I've now released coloredlogs 7.1 which supports I'm going to close this issue now because I'm not going to change the default in coloredlogs but I do think I've made it very easy to enable compatibility with |
When I install coloredlogs formatter by
coloredlogs.install(level='DEBUG', fmt='%(asctime)s %(name)s %(levelname)s -- %(message)s')
(asctime)'s output loses milliseconds (which are very important for most of a projects.
2016-03-07 22:55:10,880 ScriptManager WARNING -- Bla-bla-bla
vs.
2016-03-07 22:55:35:16 ScriptManager WARNING -- Bla-bla-bla
It should be nice to have the same format logic as standard formatter has. I use coloredlogs as optional dependency and I expect the log output to look the same with or without it installed (except colors, of course;)).
BTW, is there any way to enable milliseconds? I tried to play with datefmt a bit, but couldn't figure out what to pass to it.
The text was updated successfully, but these errors were encountered: