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 Lluís
Recipients Lluís
Date 2012-05-21.07:56:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337586969.05.0.311712609253.issue14868@psf.upfronthosting.co.za>
In-reply-to
Content
One of the problems with the logging library is that it can affect code performance when logging calls are over-utilized.

One possible solution would be to allow the compiler to remove logging calls when code is optimized with "python -O" by wrapping log calls with an assert:

   assert logging.debug("This is a test.")

Note that now debug(), info(), etc in the logging module always return "None" and this is not possible. An enhancement would be to make all logging calls to return True. In normal conditions messages would be logged without raising any error, but in optimized code they would never be called.

It is really easy to implement and I would be pleased to provide a patch for this, but I want to receive feedback from python core developers.

Thanks…
History
Date User Action Args
2012-05-21 07:56:09Lluíssetrecipients: + Lluís
2012-05-21 07:56:09Lluíssetmessageid: <1337586969.05.0.311712609253.issue14868@psf.upfronthosting.co.za>
2012-05-21 07:56:08Lluíslinkissue14868 messages
2012-05-21 07:56:08Lluíscreate