1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-25 00:23:52 +03:00

r21825: add debug prefix timestamp to allow "short timestamps" to be

added to debug messages
This commit is contained in:
Herb Lewis
2007-03-13 17:39:06 +00:00
committed by Gerald (Jerry) Carter
parent f94e5af72e
commit 4af2795e65
2 changed files with 12 additions and 2 deletions

View File

@@ -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;