From 6c1d176dc9ad42d14727778248ec68628cb4daa1 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 14 Jul 2009 17:01:26 -0400 Subject: Add option to add timestamps to debug output use '--debug-timestamps' at the command line or set 'debug-timestamps = TRUE' in the configuration file. --- server/util/server.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'server/util/server.c') diff --git a/server/util/server.c b/server/util/server.c index 4dfd18ef1..fd6e4cdc4 100644 --- a/server/util/server.c +++ b/server/util/server.c @@ -253,6 +253,7 @@ int server_setup(const char *name, int flags, uint16_t stdin_event_flags; char *conf_db; int ret = EOK; + bool dt; debug_prg_name = strdup(name); if (!debug_prg_name) { @@ -324,6 +325,17 @@ int server_setup(const char *name, int flags, return ret; } + /* same for debug timestamps */ + dt = (debug_timestamps != 0); + ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry, + "debug-timestamps", dt, &dt); + if (ret != EOK) { + DEBUG(0, ("Error reading from confdb (%d) [%s]\n", + ret, strerror(ret))); + return ret; + } + if (dt) debug_timestamps = 1; + if (flags & FLAGS_INTERACTIVE) { /* terminate when stdin goes away */ stdin_event_flags = TEVENT_FD_READ; -- cgit