When you enable debug logging the log.debug() function will automatically include the name of the function which invoked it, for example:
DEBUG(__init__) xxx DEBUG(GET) xxx
But there are many functions/methods which share the same name, that makes the debug information difficult to use unless you know the source code by heart. Which init() method is being called? Which GET() method?
It would really help if the method included it's class name. A method qualified with it's class name adds a lot of context that helps decipher the log file.
It can also be helpful to know the file and line number.
Attached is a git patch to log.py that adds the class to the method name, it also adds file and line information. The file path is trimmed to the last 3 components to keep it short, just enough context to identify the location. Now instead of
DEBUG(__init__): xxx DEBUG(GET): xxx
you'll get something like this:
DEBUG(openid/extensions/common.py:56 LoadExtensions.__init__()): xxx DEBUG(ipsilon/providers/common.py:129 LoadProviders.__init__()): xxx DEBUG(ipsilon/login/common.py:162 Form.GET()): xxx
Also included is a config option stacktrace_on_error which will add a stacktrace to the log file when logging a error. It defaults to off. A stacktrace can be really helpful when errors occur.
/etc/ipsilon.config
stacktrace_on_error = True
This issue ticket was originally removed from the tracker as it clashed with the pull request. See upstream ticket for migration details.
Metadata Update from @t0xic0der: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)