Re: Proposal: Logging system rewrite
will guaraldi <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 1 Apr 2005, Steven Armstrong wrote: > > As everybody seems to be +1 on this, what do you think about the above > problem? > > What I currently do is the following: > > I've created two functions in tools, namely: > > tools.py ---------- > > _config = None > def initialize(conf): > global _config > _config = conf > > def cleanup(): > "close logfiles and do other cleanup stuff" > > ------------------- > > I then call tools.initialize(config) from Pyblosxom.initialize. > tools.cleanup() is called from a new method I've created, > Pyblosxom.cleanup. Pyblosxom.cleanup is called at the end of the > Pyblosxom.run* methods. > > > It seems to work nicely. > Any other/better ideas how to solve this? We can't store stuff on the module level without explicitly associating it with a request. What would happen if we took logging out of the tools module and made it part of the Request object? /will ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click