diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-11-02 20:24:59 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-11-02 20:24:59 +0000 |
commit | 21fd201e17b979e77710deeb3abb54c7a2d911ce (patch) | |
tree | 7a843a499ad92a431f6fc67b1b08944f15d57869 /usr.sbin/ospf6d/log.c | |
parent | 5dfb6db929c9e9f9ca4cb190f229e5748e0c0d74 (diff) |
Add IMSG_CTL_LOG_VERBOSE similar to ospfd it allows to toggle debug logging.
henning, sthen, michele like the idea
Diffstat (limited to 'usr.sbin/ospf6d/log.c')
-rw-r--r-- | usr.sbin/ospf6d/log.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/ospf6d/log.c b/usr.sbin/ospf6d/log.c index 446268acd42..15f19b8606a 100644 --- a/usr.sbin/ospf6d/log.c +++ b/usr.sbin/ospf6d/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.4 2009/03/29 19:07:56 stsp Exp $ */ +/* $OpenBSD: log.c,v 1.5 2009/11/02 20:24:58 claudio Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -41,6 +41,7 @@ static const char * const procnames[] = { }; int debug; +int verbose; void logit(int, const char *, ...); @@ -50,6 +51,7 @@ log_init(int n_debug) extern char *__progname; debug = n_debug; + verbose = n_debug; if (!debug) openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON); @@ -58,6 +60,12 @@ log_init(int n_debug) } void +log_verbose(int v) +{ + verbose = v; +} + +void logit(int pri, const char *fmt, ...) { va_list ap; @@ -135,7 +143,7 @@ log_debug(const char *emsg, ...) { va_list ap; - if (debug) { + if (verbose) { va_start(ap, emsg); vlog(LOG_DEBUG, emsg, ap); va_end(ap); |