From 93128b863bb10aeca6202f4d5ba7935e31cf5c5f Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 13 Mar 2007 17:39:06 +0000 Subject: r21825: add debug prefix timestamp to allow "short timestamps" to be added to debug messages (This used to be commit 4af2795e65f6bab156b300d720c7ea75c944bb87) --- source3/lib/debug.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/lib/debug.c') diff --git a/source3/lib/debug.c b/source3/lib/debug.c index 5f14166110..62fda5741c 100644 --- a/source3/lib/debug.c +++ b/source3/lib/debug.c @@ -962,7 +962,7 @@ BOOL dbghdr( int level, const char *file, const char *func, int line ) /* Print the header if timestamps are turned on. If parameters are * not yet loaded, then default to timestamps on. */ - if( lp_timestamp_logs() || !(lp_loaded()) ) { + if( lp_timestamp_logs() || lp_debug_prefix_timestamp() || !(lp_loaded()) ) { char header_str[200]; header_str[0] = '\0'; @@ -980,9 +980,15 @@ BOOL dbghdr( int level, const char *file, const char *func, int line ) } /* Print it all out at once to prevent split syslog output. */ - (void)Debug1( "[%s, %d%s] %s:%s(%d)\n", + if( lp_debug_prefix_timestamp() ) { + (void)Debug1( "[%s, %d%s] ", + current_timestring(lp_debug_hires_timestamp()), level, + header_str); + } else { + (void)Debug1( "[%s, %d%s] %s:%s(%d)\n", current_timestring(lp_debug_hires_timestamp()), level, header_str, file, func, line ); + } } errno = old_errno; -- cgit