[PATCH] debug: Print header when logging to stdout

Christof Schmitt cs at samba.org
Tue Dec 9 09:26:26 MST 2014


On Tue, Dec 09, 2014 at 05:23:54PM +0100, Michael Adam wrote:
> reviewed-by me.
> 
> Has noone pushed it or have there been problems with autobuild?
> I will try to autobuild/push later.
> 
> Michael

Thanks. I was waiting for comments for others, and also got distracted
with other work. It seems like the majority opinion is to go forward
with this change. If this change uncovers problems with autobuild, we
need to address those. Feel free to push.

Christof

> 
> On 2014-11-21 at 14:52 -0700, Christof Schmitt wrote:
> > This patch changes the debug code, so that the header is always printed.
> > I find this useful for debugging interactive commands with -d10. Always
> > having the debug header in the output would also make the explicit
> > function name in the debug message obsolete.
> > 
> > I assume that there is a historical reason for the behavior in the debug
> > code; does anybody know why the debug code behaves differently for
> > stdout and logging to a file?
> > 
> > Christof
> 
> > From c3f9fcde891dcfb41468292d99f6ee112c149d6c Mon Sep 17 00:00:00 2001
> > From: Christof Schmitt <cs at samba.org>
> > Date: Fri, 21 Nov 2014 14:44:38 -0700
> > Subject: [PATCH] debug: Print header when logging to stdout
> > 
> > Having the source line of the error messages helps debugging interactive
> > commands.
> > 
> > Signed-off-by: Christof Schmitt <cs at samba.org>
> > ---
> >  lib/util/debug.c |    5 -----
> >  1 files changed, 0 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/util/debug.c b/lib/util/debug.c
> > index 750ad25..31a203b 100644
> > --- a/lib/util/debug.c
> > +++ b/lib/util/debug.c
> > @@ -969,11 +969,6 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
> >  	/* Set current_msg_level. */
> >  	current_msg_level = level;
> >  
> > -	/* Don't print a header if we're logging to stdout. */
> > -	if ( state.logtype != DEBUG_FILE ) {
> > -		return( true );
> > -	}
> > -
> >  	/* Print the header if timestamps are turned on.  If parameters are
> >  	 * not yet loaded, then default to timestamps on.
> >  	 */
> > -- 
> > 1.7.1
> > 
> 




More information about the samba-technical mailing list