Bitcoin Forum
August 22, 2017, 01:59:33 AM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [Pull] Rework debug logging  (Read 932 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
1503367173
Hero Member
*
Offline Offline

Posts: 1503367173

View Profile Personal Message (Offline)

Ignore
1503367173
Reply with quote  #2

1503367173
Report to moderator
Creating a Bitcoin client that fully implements the network protocol is extremely difficult. Bitcoin-Qt is the only known safe implementation of a full node. Some other projects attempt to compete, but it is not recommended to use such software for anything serious. (Lightweight clients like Electrum and MultiBit are OK.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1503367173
Hero Member
*
Offline Offline

Posts: 1503367173

View Profile Personal Message (Offline)

Ignore
1503367173
Reply with quote  #2

1503367173
Report to moderator
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!