On 4/27/06, fumanchu <[EMAIL PROTECTED]> wrote: > > > Why not just using the logging module with well-defined categories? > > First, because the logging module doesn't have categories, only > "levels". The categories in Dejavu (IO, SQL, SANDBOX) and CP (access > log vs "everything else") aren't heirarchical.
The hierarchical thing is effectively categories. I stuck accesses in "turbogears.access" and CP's everything else in "cherrypy.msg". > Second, because then CP is taking a stand I don't think it should take, > which is "if you want to log CP events, you must use Python's builtin > logging module". There are plenty of people who think the stdlib module > is overengineered, and "doesn't scale down very well". See > http://www.mechanicalcat.net/richard/log/Python/Simple_usage_of_Python_s_logging_module > for example. It certainly doesn't support cooperative logging very > well, IMO. I agree that having to write an extra 5 lines of somewhat inscrutible code is unfortunate. That said, CherryPy can pretty easily wrap up a basic configuration that works for CP's own output. logging module has the benefit of being part of the stdlib. I'm not sure what you mean by "cooperative logging". It's pretty easy to put log messages of different levels into different hierarchical categories and configure those categories to go to one or more final destinations in various formats. > At the level of TG, this isn't a huge issue, since you can pick a > standard. But CP should probably not force it. To put it another way, > how would you feel if CP standardized on easylog or twisted.log? Another log package is probably fine (except CP doesn't like dependencies :), but logging is part of stdlib and is capable enough. > To avoid those debates, I think libraries should be "event faucets" > that have a simple interface, not tied to any logging "sink" framework. > But I'll write a stdlib-logging implementation today to find out if I'm > wrong. ;) Certainly the best way to see what works and doesn't for you :) I doubt there's a need to try *every* logging implementation out there, but it does make sense to see if stdlib logging works for you. Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk -~----------~----~----~----~------~----~------~--~---
