From 21fd201e17b979e77710deeb3abb54c7a2d911ce Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 2 Nov 2009 20:24:59 +0000 Subject: Add IMSG_CTL_LOG_VERBOSE similar to ospfd it allows to toggle debug logging. henning, sthen, michele like the idea --- usr.sbin/ospf6d/log.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ospf6d/log.c') 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 @@ -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); @@ -57,6 +59,12 @@ log_init(int n_debug) tzset(); } +void +log_verbose(int v) +{ + verbose = v; +} + void logit(int pri, const char *fmt, ...) { @@ -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); -- cgit v1.2.3