]> mj.ucw.cz Git - libucw.git/commitdiff
Logging: LOG_STREAM_DEFAULT is no longer needed.
authorMartin Mares <mj@ucw.cz>
Fri, 13 Feb 2009 23:37:33 +0000 (00:37 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 13 Feb 2009 23:37:33 +0000 (00:37 +0100)
As we have un-constified log_stream_default, the casts are no longer
necessary, so I have removed the macro.

ucw/log.c
ucw/log.h

index afda7a0ca05c3521e9733d51a2e97d9e2eb119d9..19609809f9b36b632dc92bdd513d65b61a2cd961 100644 (file)
--- 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 */
index d6c240a43642b41697e7c4a8023f634e988455a6..09be0b173d90f473c21c2c0ccdda9164b3d54805 100644 (file)
--- 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