Gary Jefferson wrote:
> So maybe I don't have all this figured out quite as well as I thought.
> What I really want to do is set an environment variable, MYDEBUG, which
> contains a list of wildcarded logger names, such as "a.*.c a.d" (which
> becomes ['a.*.c', 'a.d'], and then selectively crank th
So maybe I don't have all this figured out quite as well as I thought.
What I really want to do is set an environment variable, MYDEBUG, which
contains a list of wildcarded logger names, such as "a.*.c a.d" (which
becomes ['a.*.c', 'a.d'], and then selectively crank the loglevel up to
DEBUG for tho
Gary Jefferson wrote:
> Vinay Sajip wrote:
> >
> > BTW I would also advise reading PEP-282 to understand more about the
> > logging approach.
>
>
> You've been most helpful, Vinay. The PEP section on Filters states
> that I can do what I've been trying to do with filters, but doesn't
> provide en
Gary Jefferson wrote:
> Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B',
> and each module has its own logger, created with:
>
> module1logger = logging.getLogger('project.A')
>
> and
>
> module2logger = logging.getLogger('project.A.a')
>
> and
>
> module3logger = loggin
Vinay Sajip wrote:
>
> BTW I would also advise reading PEP-282 to understand more about the
> logging approach.
You've been most helpful, Vinay. The PEP section on Filters states
that I can do what I've been trying to do with filters, but doesn't
provide enough information to do it (or, at leas
Gary Jefferson wrote:
> I am still a bit confused about Filters, though. It seems they are a
> bit of an anomoly in the hierarchical view of loggers that the API
> supports elsewhere, i.e., filters don't seem to inherit... Or am I
> missing something again? Here's a quick example:
>
> import lo
Vinay Sajip wrote:
>
> I don't know enough about your target environment and application to
> necessarily give you the best advice, but I'll make some general
> comments which I hope are useful. You seem to be thinking that loggers
> are binary - i.e. you turn them on or off. But they can be contr
Gary Jefferson wrote:
> Thanks for the reply Vinay. I had been reading those docs prior to
> posting, but addFilter/removeFilter only work on individual logger
> instances and handlers. I want to globally enable/disable multiple
> logger instances, based on their namespaces (see the example I
>
Vinay Sajip wrote:
>
> The documentation for Logger - see
>
> http://docs.python.org/lib/node406.html
>
> - shows that there are addFilter() and removeFilter() methods on the
> Logger class which you can use to add or remove filters from individual
> Logger instances. From the above page (entitled
Gary Jefferson wrote:
> Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B',
> and each module has its own logger, created with:
>
> module1logger = logging.getLogger('project.A')
>
> and
>
> module2logger = logging.getLogger('project.A.a')
>
> and
>
> module3logger = logging.get
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B',
and each module has its own logger, created with:
module1logger = logging.getLogger('project.A')
and
module2logger = logging.getLogger('project.A.a')
and
module3logger = logging.getLogger('project.B')
And I want to select
11 matches
Mail list logo