Re: [Python-Dev] Guidelines for Logging Usage

Garth T Kidd wrote:
Main purpose of logging module is not redirection, but filtering capability. -- Best regards, Michael Dubner (dubnerm@mindless.com) Brainbench MVP/HTML+JavaScript (http://www.brainbench.com) PS: Sorry for my English

It since occurred to me that people might want the standard library to be the canonical example of Good Python rather than some messy kludge. :) So, replacing print with appropriate direct calls to logging or warnings would be more appropriate than hooking print into those frameworks by futzing around with handles. Speaking of which: any thoughts on having warnings use logging rather than print? I'm showing 224 files in Lib\ without 'test' in the name and with print statements, though some of those are sensible (like zipfile.ZipFile.printdir) and some look like internal tests. Only cookielib, _LWPCookieJar.py and _MozillaCookieJar seem to import the logging module. So, you've got some real work on your hands updating everything to use logging. Cookie, cookielib, distutils, email, filecmp, idlelib, pickle, plat-mac, posixfile, pydoc, random, reconvert, regsub, shelve, statcache, tempfile, tzparse, whrandom and xmllib all import warnings. I'm not sure if it's appropriate to timestamp the root logger going to console by default; WARNING:module:message is messy enough without a timestamp. Regards, Garth. On Tue, 05 Oct 2004 10:18:18 +0400, Michael P. Dubner <dubnerm-news@mail.ru> wrote:

It since occurred to me that people might want the standard library to be the canonical example of Good Python rather than some messy kludge. :) So, replacing print with appropriate direct calls to logging or warnings would be more appropriate than hooking print into those frameworks by futzing around with handles. Speaking of which: any thoughts on having warnings use logging rather than print? I'm showing 224 files in Lib\ without 'test' in the name and with print statements, though some of those are sensible (like zipfile.ZipFile.printdir) and some look like internal tests. Only cookielib, _LWPCookieJar.py and _MozillaCookieJar seem to import the logging module. So, you've got some real work on your hands updating everything to use logging. Cookie, cookielib, distutils, email, filecmp, idlelib, pickle, plat-mac, posixfile, pydoc, random, reconvert, regsub, shelve, statcache, tempfile, tzparse, whrandom and xmllib all import warnings. I'm not sure if it's appropriate to timestamp the root logger going to console by default; WARNING:module:message is messy enough without a timestamp. Regards, Garth. On Tue, 05 Oct 2004 10:18:18 +0400, Michael P. Dubner <dubnerm-news@mail.ru> wrote:
participants (2)
-
Garth T Kidd
-
Michael P. Dubner