summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/log.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-11-02 20:20:55 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-11-02 20:20:55 +0000
commitaa53dd77fecb39b8af5c2ae7d479db56e491f531 (patch)
tree499a42441af206e972343fcc21f513936283c24e /usr.sbin/ospfd/log.c
parent1adab4b79b2c73776ff153349b667ef99008fbd8 (diff)
Implement IMSG_CTL_LOG_VERBOSE to enable or disable debug logging on runtime.
It always annoyed me that in case of a problem I had to restart the ospf in forground debug mode and by doing so losing all routes at least twice. OK henning, sthen, michele
Diffstat (limited to 'usr.sbin/ospfd/log.c')
-rw-r--r--usr.sbin/ospfd/log.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/log.c b/usr.sbin/ospfd/log.c
index ebba51eb84b..e8326b81d45 100644
--- a/usr.sbin/ospfd/log.c
+++ b/usr.sbin/ospfd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.5 2006/03/09 16:58:40 claudio Exp $ */
+/* $OpenBSD: log.c,v 1.6 2009/11/02 20:20:54 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -34,6 +34,7 @@ static const char * const procnames[] = {
};
int debug;
+int verbose;
void logit(int, const char *, ...);
@@ -43,6 +44,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);
@@ -51,6 +53,12 @@ log_init(int n_debug)
}
void
+log_verbose(int v)
+{
+ verbose = v;
+}
+
+void
logit(int pri, const char *fmt, ...)
{
va_list ap;
@@ -128,7 +136,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);