Message332115
The call to logging.error() is irrelevant, since there's no expectation that the module-level function will necessarily output the same as a method of a specific instance logger.error().
I agree that is it quite curious that the first call to logger.error outputs something different from the second.
The documentation says:
The default format set by basicConfig() for messages is:
severity:logger name:message
( Paragraph just above this:
https://docs.python.org/3.5/howto/logging.html#logging-flow )
but you don't call basicConfig. I'm not sure that it is mandatory though.
It looks like a bug to *me*, but I'm not a logging expert. I'm seeing the same behaviour in 3.5 and 3.7, but in 2.7.1 the first call to logger.error prints an error message:
No handlers could be found for logger "main" |
|
Date |
User |
Action |
Args |
2018-12-19 09:29:12 | steven.daprano | set | recipients:
+ steven.daprano, vinay.sajip, porton |
2018-12-19 09:29:11 | steven.daprano | set | messageid: <1545211751.94.0.788709270274.issue35530@psf.upfronthosting.co.za> |
2018-12-19 09:29:11 | steven.daprano | link | issue35530 messages |
2018-12-19 09:29:11 | steven.daprano | create | |
|