Issue 34020: Add '%(asctime)s' into default BASIC_FORMAT in logging module (original) (raw)
Issue34020
Created on 2018-07-02 10:04 by Leon H., last changed 2022-04-11 14:59 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg320864 - (view) | Author: Leon H. (Leon H.) | Date: 2018-07-02 10:04 |
Current BASIC_FORMAT: BASIC_FORMAT = "%(levelname)s:%(name)s:%(message)s" The first thing people do is set the format to '%(asctime)s:%(levelname)s:%(name)s:%(message)s' or like after importing logging module. Could we put the '%(asctime)s' into the default BASIC_FORMAT setting and save everyone's time? | ||
msg320866 - (view) | Author: Eric V. Smith (eric.smith) * ![]() |
Date: 2018-07-02 10:17 |
Unfortunately, I don't see how we can do this without breaking code that assumes the default log format doesn't have the timestamp in it. In particular, I'm thinking of external log file parsers. | ||
msg320869 - (view) | Author: Vinay Sajip (vinay.sajip) * ![]() |
Date: 2018-07-02 10:55 |
> The first thing people do is set the format to '%(asctime)s:%(levelname)s:%(name)s:%(message)s' or like after importing logging module. "People" - you don't claim to speak for *everyone*, right? basicConfig() takes a format= keyword argument that you can use to specify your required format string. Since you have to call basicConfig() anyway, it seems little hardship to specify the format you want in your call. Closing as "not a bug", which here is to be interpreted as "not an enhancement that's needed". |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:59:02 | admin | set | github: 78201 |
2018-07-02 10:55:47 | vinay.sajip | set | status: open -> closedresolution: not a bugmessages: + stage: resolved |
2018-07-02 10:17:32 | eric.smith | set | nosy: + vinay.sajip, eric.smithmessages: + |
2018-07-02 10:04:44 | Leon H. | create |