This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients porton, steven.daprano, vinay.sajip
Date 2018-12-19.09:29:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545211751.94.0.788709270274.issue35530@psf.upfronthosting.co.za>
In-reply-to
Content
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"
History
Date User Action Args
2018-12-19 09:29:12steven.dapranosetrecipients: + steven.daprano, vinay.sajip, porton
2018-12-19 09:29:11steven.dapranosetmessageid: <1545211751.94.0.788709270274.issue35530@psf.upfronthosting.co.za>
2018-12-19 09:29:11steven.dapranolinkissue35530 messages
2018-12-19 09:29:11steven.dapranocreate