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).