On Aug 18, 2010, at 6:36 AM, Yarin wrote: >> The reason for named loggers is twofold. One is trivial: to identify the >> source of log messages. > Logging already tracks module, function, lineno... we can even insert > a stack trace >> The other ... to let us have different log levels for different loggers. > But it looks like you're introducing several named loggers only to log > several messages at startup. For example, your "web2py.sql" logger's > only function is to log a single driver exception. As far as I can > tell, only the "web2py.rewrite" logger does any continuous work. And > I assume the Rocket logger does a lot of work. But beyond that I > can't see the justification in forcing the framework to create and > configure a number of different loggers that will only be used once, > if at all?
Mostly for purposes of example. The web2py.foo loggers needn't appear in the config file; they can all use the web2py logger (I keep writing 'blogger'). The Rocket module is (I think) independent of web2py; if not, I'd have changed its logger (or asked Tim to do so) to something like 'web2py.rocket.*' (maybe we could pass a logger base name in to it). Identifying the source of the log messages through the logger name is useful for more than human consumption. log levels is one use; another is choice of handler. I'd have no objection to consolidating the startup-only loggers into 'web2py.startup', though I think that a noisy logger (even if noisy only at startup) ought to have its own name.