#2246: tg/configuration.py passes a logging.Logger instead of expected stream
object
------------------------+---------------------------------------------------
Reporter: amol | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 2.0rc1
Component: TurboGears | Version: 2.0b6
Severity: normal | Keywords:
------------------------+---------------------------------------------------
tg/configuration.py : add_auth_middleware
does:
{{{
# Configuring auth logging:
if 'log_stream' not in self.sa_auth:
self.sa_auth['log_stream'] = logging.getLogger('auth')
}}}
but repoze.who expects to get a stream object with write method in
sa_auth['log_stream'] and so raises an exception when performing
stream.write on the logger
repoze/who/middleware.py : PluggableAuthenticationMiddleware : __init__
does
{{{
if log_stream:
handler = logging.StreamHandler(log_stream)
fmt = '%(asctime)s %(message)s'
formatter = logging.Formatter(fmt)
handler.setFormatter(formatter)
self.logger = logging.Logger('repoze.who')
self.logger.addHandler(handler)
self.logger.setLevel(log_level)
}}}
which creates a new logger from log_stream using it as a StreamHandler
even if it is already a Logger instance.
--
Ticket URL: <http://trac.turbogears.org/ticket/2246>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---