[Python-Dev] Guidelines for Logging Usage

Nick Coghlan ncoghlan at email.com
Sat Oct 9 02:04:01 CEST 2004

Quoting "Michael P. Dubner" <dubnerm-news at mail.ru>:
> >There's been discussion in the past of having a name for the Python
> >standard library, so that 'from <name> import httplib' would always
> >get the standard httplib module.  This name should match whatever's
> >using in the logging, so the logging should use a name everyone is
> >happy with using in import statements.  Whether that's stdlib or std
> >or __std__ or Lib isn't important, as long as the logging matches.
> >  
> >
> I'm not really sure that these names MUST be equal. Name to use for 
> import statement can be __stdlib__
> or ever __python_library__ to ensure uniqueness and specific name MUST 
> draw attention to this place. But
> for logger name this prefix should be as short as possible because it's 
> to be displayed, and sometime logger
> plus time, level and message text must fit 80 character line...

I agree with Andrew that the names should be equal - consistency is good, and
brevity is a benefit for 'from x import' as well.

I'd propose taking a tip from Java and using "py." as the prefix for the stdlib.
Short, to the point, and I'd be surprised if anyone was using a bare "py" as a
package or module name.


Nick Coghlan
Brisbane, Australia

More information about the Python-Dev mailing list