Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #820 (closed defect: fixed)

Opened 12 years ago

Last modified 10 years ago

confusing error messages configuring logging

Reported by: max Owned by: anonymous
Priority: normal Milestone: 1.0b1
Component: TurboGears Version: 0.9a5
Severity: normal Keywords: logging configuration
Cc:

Description

Given the following logging configuration in my dev.cfg:

 [[handlers]]
 [[[debug_out]]]
 class='FileHandler'
 level='DEBUG'
 args=('spaca-tg.log', 'at+')

Gives weird error message:

 Traceback (most recent call last):
   File "D:\Projects\Spaca\start-spaca.py", line 23, in ?
     modulename="spaca.config")
   File "d:\projects\3rd-party\turbogears-1.0\turbogears\config.py", line 181, in
pdate_config
     configure_loggers(configdict)
   File "d:\projects\3rd-party\turbogears-1.0\turbogears\config.py", line 129, in
onfigure_loggers
     _get_handlers(handlers, formatters)
   File "d:\projects\3rd-party\turbogears-1.0\turbogears\config.py", line 41, in _get_handlers
     args = eval(args, logging.__dict__)
 TypeError: eval() arg 1 must be a string or code object

At a bare minimum, error messages should be more user-friendly.

In this case, TG could have probably accept a tuple as "args" option (a string is required, which is non obvious).

Change History

comment:1 Changed 12 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed

Fixed by #866.

Note: See TracTickets for help on using tickets.