Bitcoin Forum
December 11, 2016, 12:18:54 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [Pull] Rework debug logging  (Read 868 times)
Jim Hyslop
Member
**
Offline Offline

Activity: 98


View Profile
April 06, 2011, 12:45:25 AM
 #1

Following sipa's example here Smiley

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 Problem
The 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 Patch
The 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.

Compatibility
Existing 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.


Like my answer? Did I help? Tips gratefully accepted here: 1H6wM8Xj8GNrhqWBrnDugd8Vf3nAfZgMnq
1481458734
Hero Member
*
Offline Offline

Posts: 1481458734

View Profile Personal Message (Offline)

Ignore
1481458734
Reply with quote  #2

1481458734
Report to moderator
1481458734
Hero Member
*
Offline Offline

Posts: 1481458734

View Profile Personal Message (Offline)

Ignore
1481458734
Reply with quote  #2

1481458734
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Cryptoman
Hero Member
*****
Offline Offline

Activity: 728



View Profile
April 06, 2011, 03:13:21 AM
 #2

The Problem
The 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.

Thousands of lines in my case.  This is a welcome addition.

"A small body of determined spirits fired by an unquenchable faith in their mission can alter the course of history." --Gandhi
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!