diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-07-19 19:29:09 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-08-18 11:46:32 +0930 |
commit | 9fbb191b78a0cef008166fbc2bdad454735b8e1c (patch) | |
tree | c016891d655a2313e5421b1d44e06e297b695259 /ctdb/lib/util/debug.c | |
parent | 1a009aff73cd3fa0e9653c35581283bd4de614e3 (diff) | |
download | samba-9fbb191b78a0cef008166fbc2bdad454735b8e1c.tar.gz samba-9fbb191b78a0cef008166fbc2bdad454735b8e1c.tar.xz samba-9fbb191b78a0cef008166fbc2bdad454735b8e1c.zip |
logging: give a unique logging name to each forked child.
This means we can distinguish which child is logging, esp. via syslog where we have no pid.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 68b3761a0874429b90731741f0531f76dcfbb081)
Diffstat (limited to 'ctdb/lib/util/debug.c')
-rw-r--r-- | ctdb/lib/util/debug.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/lib/util/debug.c b/ctdb/lib/util/debug.c index 1cbaa230f1..e9365d88f6 100644 --- a/ctdb/lib/util/debug.c +++ b/ctdb/lib/util/debug.c @@ -42,13 +42,15 @@ static void _do_debug_v(const char *format, va_list ap) strftime(tbuf,sizeof(tbuf)-1,"%Y/%m/%d %H:%M:%S", tm); - fprintf(stderr, "%s.%06u [%5u]: %s", tbuf, (unsigned)t.tv_usec, (unsigned)getpid(), s); + fprintf(stderr, "%s.%06u [%s%5u]: %s", tbuf, (unsigned)t.tv_usec, + debug_extra, (unsigned)getpid(), s); fflush(stderr); free(s); } /* default logging function */ void (*do_debug_v)(const char *, va_list ap) = _do_debug_v; +const char *debug_extra = ""; void do_debug(const char *format, ...) { |