From b3e9e3e4a253e0e5eb5f7ba74b457f59baa77048 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 19 Feb 2009 18:55:08 +0100 Subject: [PATCH] Logging: Fatality of logging errors is configurable. --- cf/libucw | 1 + ucw/log-conf.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cf/libucw b/cf/libucw index a6f19919..effeb25a 100644 --- a/cf/libucw +++ b/cf/libucw @@ -187,6 +187,7 @@ Stream { FileName log/test2 Microseconds 1 Levels:reset warn error + ErrorsFatal 1 } Stream { diff --git a/ucw/log-conf.c b/ucw/log-conf.c index 6a92c20e..bea6ad0c 100644 --- a/ucw/log-conf.c +++ b/ucw/log-conf.c @@ -24,6 +24,7 @@ struct stream_config { clist substreams; // simple_list of names int microseconds; // Enable logging of precise timestamps int syslog_pids; + int errors_fatal; struct log_stream *ls; int mark; // Used temporarily in log_config_commit() }; @@ -71,6 +72,7 @@ static struct cf_section stream_config = { CF_LIST("Substream", P(substreams), &cf_string_list_config), CF_INT("Microseconds", P(microseconds)), CF_INT("SyslogPID", P(syslog_pids)), + CF_INT("ErrorsFatal", P(errors_fatal)), #undef P CF_END } @@ -171,6 +173,8 @@ do_new_configured(struct stream_config *c) ls->levels = c->levels; if (c->microseconds) ls->msgfmt |= LSFMT_USEC; + if (c->errors_fatal) + ls->stream_flags |= LSFLAG_ERR_IS_FATAL; c->ls = ls; return ls; -- 2.39.2