From: Martin Mares Date: Fri, 13 Feb 2009 23:37:33 +0000 (+0100) Subject: Logging: LOG_STREAM_DEFAULT is no longer needed. X-Git-Tag: holmes-import~90 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=64ebae182951545e635fb27cac324909a8b34e9e;p=libucw.git Logging: LOG_STREAM_DEFAULT is no longer needed. As we have un-constified log_stream_default, the casts are no longer necessary, so I have removed the macro. --- diff --git a/ucw/log.c b/ucw/log.c index afda7a0c..19609809 100644 --- a/ucw/log.c +++ b/ucw/log.c @@ -65,7 +65,7 @@ log_stream_by_flags(uns flags) { int n = LS_GET_STRNUM(flags); if (n < 0 || n >= log_streams_after || log_streams.ptr[n]->regnum == -1) - return (n ? NULL : LOG_STREAM_DEFAULT); + return (n ? NULL : &log_stream_default); return log_streams.ptr[n]; } @@ -89,7 +89,7 @@ vmsg(uns cat, const char *fmt, va_list args) if (!ls) { msg((LS_INTERNAL_MASK&cat)|L_WARN, "No log_stream with number %d! Logging to the default log.", LS_GET_STRNUM(cat)); - ls = LOG_STREAM_DEFAULT; + ls = &log_stream_default; } /* Get the current time */ @@ -140,7 +140,7 @@ vmsg(uns cat, const char *fmt, va_list args) if (log_pass_msg(0, ls, &m)) { /* Error (such as infinite loop) occurred */ - log_pass_msg(0, LOG_STREAM_DEFAULT, &m); + log_pass_msg(0, &log_stream_default, &m); } if (m.raw_msg != msgbuf) @@ -161,7 +161,7 @@ log_pass_msg(int depth, struct log_stream *ls, struct log_msg *m) struct log_msg errm = *m; errm.flags = L_ERROR | (m->flags & LS_INTERNAL_MASK); errm.raw_msg = "Loop in the log_stream system detected."; - log_pass_msg(0, LOG_STREAM_DEFAULT, &errm); + log_pass_msg(0, &log_stream_default, &errm); } /* Filter by level and hook function */ diff --git a/ucw/log.h b/ucw/log.h index d6c240a4..09be0b17 100644 --- a/ucw/log.h +++ b/ucw/log.h @@ -45,7 +45,6 @@ struct log_stream /* the default logger */ extern struct log_stream log_stream_default; -#define LOG_STREAM_DEFAULT &log_stream_default /* A message is processed as follows: * 1. Discard if message level not in levels