Bitcoin Forum
May 10, 2024, 08:19:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Pull] Rework debug logging  (Read 1067 times)
Jim Hyslop (OP)
Member
**
Offline Offline

Activity: 98
Merit: 20


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
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715372341
Hero Member
*
Offline Offline

Posts: 1715372341

View Profile Personal Message (Offline)

Ignore
1715372341
Reply with quote  #2

1715372341
Report to moderator
1715372341
Hero Member
*
Offline Offline

Posts: 1715372341

View Profile Personal Message (Offline)

Ignore
1715372341
Reply with quote  #2

1715372341
Report to moderator
Cryptoman
Hero Member
*****
Offline Offline

Activity: 726
Merit: 500



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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!