debug prints

Jeremy Allison jra at samba.org
Tue Aug 7 22:14:17 MDT 2012


On Wed, Aug 08, 2012 at 12:44:26PM +1000, Andrew Bartlett wrote:
> On Tue, 2012-08-07 at 16:11 -0700, Herb Lewis wrote:
> > There was some discussion a while back about always including the 
> > function name in the
> > debug header. I'd like to propose the following patch. It does 2 things. 
> > It adds printing
> > "func" value passed to the dbghdrclass function in all 3 cases - no 
> > timestamp, normal
> > timestamp and debug prefix timestamp. It also changes dbghdrclass to use 
> > dbgtext
> > instead of Debug1 so the whole line is printed at the same time. This 
> > prevents log.smbd
> > from having many garbled lines when there is heavy traffic.
> > 
> > Of course when this patch is applied we need to clean up all the DEBUG 
> > statements to
> > not print the (many times incorrect) function name.
> 
> Additionally in the same function, we should get rid of:
> 
> 	/* Don't print a header if we're logging to stdout. */
> 	if ( state.logtype != DEBUG_FILE ) {
> 		return( true );
> 	}
> 
> That is, always print it, even when logging to stdout.  This will assist
> the --foreground case we use with s3fs, and client utilities.  if this
> makes a 'user message' ugly, then we should change that output to go via
> d_printf(), and not DEBUG().
> 
> Thanks for chasing this up.

Yep - +1 from me on this.

Herb, do you want to push this directly or do you want
someone else to push after more review ?

Jeremy


More information about the samba-technical mailing list