Thanks for your help, Jorge.
On Dec 9, 11:25 am, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> Then you can create your handlers on your code by using, on the beginning of
> your file:
>
> import logging
> log = logging.getLogger('testing123')
>
> class YourClass(Controller):
> ...
>
> log will be a global variable, accessible everywhere within the module. I
> usually change this for:
>
> import logging
> log = logging.getLogger('testing123.module_name')
>
> So that I have more context on the logged message.
But is this the same object as above then? Neither the TG or the
Python docs are clear on this. I don't understand what this string
parameter corresponds to, if anything. The implication is that you get
given a logger with that name, but that name doesn't match any of the
logger names given in the ,cfg file, so what would you get? It's all
very confusing!
> As above. You don't have a log object until you get it. What TG does is
> initializing one with the definitions you supplied, but you still have to get
> it. If you don't use the one initialized on dev.cfg/prod.cfg
Is that one? It looks more like three! It seems like there isn't a
consistent definition of what a 'logger' is.
--
Ben Sizer
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---