Opened 2 years ago

Last modified 20 months ago

#8841 defect new

Loggers cannot have namespaces when used as descriptors

Reported by: Julian Berman Owned by:
Priority: normal Milestone:
Component: logger Keywords:
Cc: wsanchez@… Branch:
Author:

Description

Giving a namespace to a logger has no effect if the logger is a class attribute.

I.e.

>>> from twisted.logger import Logger
>>> class F(object):
...         blah = Logger(namespace="asdf")
...         print blah
...
...
<Logger 'asdf'>
>>> print F.blah, F().blah
<Logger '__console__.F'> <Logger '__console__.F'>

Change History (4)

comment:1 Changed 2 years ago by Wilfredo Sánchez Vega

Cc: wsanchez@… added

I think this is because Logger.__get__ constructs a new namespace argument instead of re-using self.namespace.

Glyph, any rememberings on why you may have done that here? I know why we set source here, but not the name space arg.

comment:2 Changed 2 years ago by Wilfredo Sánchez Vega

Keywords: logger removed
Milestone: New Logging System

comment:3 Changed 22 months ago by Wilfredo Sánchez Vega

Component: corelogger

comment:4 Changed 20 months ago by Wilfredo Sánchez Vega

Milestone: New Logging System

Closing New Logging System milestone; use logger component for ongoing tickets.

Note: See TracTickets for help on using tickets.