Re: How to package a logging.config file?

2008-07-15 Thread Vinay Sajip
On Jul 15, 3:04 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > On Mon 14 Jul 2008 09:25:19 AM EDT, Vinay Sajip wrote: > > > Is your package a library or an application? If it's a library, you > > should avoid configuringloggingusing a config file - this is because > >loggingconfiguration is proces

Re: How to package a logging.config file?

2008-07-15 Thread Matthew Wilson
On Mon 14 Jul 2008 09:25:19 AM EDT, Vinay Sajip wrote: > Is your package a library or an application? If it's a library, you > should avoid configuring logging using a config file - this is because > logging configuration is process-wide, and if multiple libraries use > fileConfig to configure thei

RE: How to package a logging.config file?

2008-07-14 Thread Younger Wang
I had the similar question and my solution is: default_config = os.path.join(os.getcwd(), "log.config") def get_logger(name, config_file=None): if config_file: logging.config.fileConfig(config_file) else: logging.basicConfig(level=logging.INFO,

Re: How to package a logging.config file?

2008-07-14 Thread Vinay Sajip
On Jul 14, 1:21 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I'm working on a package that uses the standard libraryloggingmodule > along with a .cfg file. > > In my code, I uselogging.config.fileConfig('/home/matt/mypackage/matt.cfg') > to load in > theloggingconfig file. > > However, it seems

Re: How to package a logging.config file?

2008-07-13 Thread Larry Bates
Matthew Wilson wrote: I'm working on a package that uses the standard library logging module along with a .cfg file. In my code, I use logging.config.fileConfig('/home/matt/mypackage/matt.cfg') to load in the logging config file. However, it seems really obvious to me that this won't work when