On Sat, Jan 10, 2009 at 4:51 PM, Herb <[email protected]> wrote: > > Thanks, Jorge. > > I did that. I set them all to the same: > > import logging > log = logging.getLogger("mypackage.controllers") > > It made no difference. And yes, I had read > http://docs.turbogears.org/1.0/LoggingSystem. > It still repeats every log entry six times. > > Here is another way of asking a similar question: > How do I instantiate logging in a module that may be called as part of > any number of different packages? I this case, I can change the > various modules, but if I were to reuse one of these modules in > another package, it would be set to the wrong name, unless > "mypackage.controllers" should be taken literally rather than > inserting the name of my package in place of "mypackage." > I'm sorry I'm not following, could you post your calling code? the way the python logging module works the line above will look for a logger called "mypackage.controllers" if it doesn't exists it will create one. therefore it's effectively a "singleton" all calls to log.xxx will be loggged just ones, that's how it works.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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?hl=en -~----------~----~----~----~------~----~------~--~---

