diff options
author | Herb Lewis <herb@samba.org> | 2007-03-13 17:39:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:37 -0500 |
commit | 93128b863bb10aeca6202f4d5ba7935e31cf5c5f (patch) | |
tree | 768cc05a21503b6c50b0dc1e5c4140f715f5f012 /source3/lib/debug.c | |
parent | aa6055debd078504f6a7ed861443b02672fc9067 (diff) | |
download | samba-93128b863bb10aeca6202f4d5ba7935e31cf5c5f.tar.gz samba-93128b863bb10aeca6202f4d5ba7935e31cf5c5f.tar.xz samba-93128b863bb10aeca6202f4d5ba7935e31cf5c5f.zip |
r21825: add debug prefix timestamp to allow "short timestamps" to be
added to debug messages
(This used to be commit 4af2795e65f6bab156b300d720c7ea75c944bb87)
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r-- | source3/lib/debug.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c index 5f141661106..62fda5741c9 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; |