Following sipa's example here
The pull request
for revamped debug logging has been open for a few weeks now, with very little discussion on it. I'd like to have some discussion here, in the hopes of having it pulled.
The ProblemThe debug log file can grow very quickly. If you are looking for something in particular while debugging, you have to sift through hundreds of lines of debug output that do not apply to the problem at hand.
The PatchThe patch introduces a new function, OutputLogMessageF. This function contains the functionality in the existing OutputDebugStringF. OutputLogMessageF adds two new parameters:
- a value indicating the context of the message (such as transactions, IRC, etc.)
- the severity of the message (error, warning, info, etc.)
The existing OutputDebugStringF function forwards its call to OutputLogMessageF, using parameters to indicate All contexts, severity Warning.
Several functions have been added to support command-line configuration of logging.
CompatibilityExisting code does not have to change in order to use the logging. It can be migrated from the existing 'printf' macro to the function call as developers work on a particular section of code.