]> andersk Git - moira.git/blobdiff - update/log.c
added sms_untar
[moira.git] / update / log.c
index 7d352bb2c8fcc5971b7a16fe478f4e84eb6edab0..651fa3e257872690b091afedc7decf7880fcd7d6 100644 (file)
@@ -2,6 +2,9 @@
  *     $Source$
  *     $Header$
  */
+/*  (c) Copyright 1988 by the Massachusetts Institute of Technology. */
+/*  For copying and distribution information, please see the file */
+/*  <mit-copyright.h>. */
 
 #ifndef lint
 static char *rcsid_log_c = "$Header$";
@@ -17,8 +20,8 @@ static char *rcsid_log_c = "$Header$";
  * define syslog for using syslog,
  * default to tty
  */
-#define use_syslog
 
+#include <mit-copyright.h>
 #include <stdio.h>
 #include "com_err.h"
 #include <varargs.h>
@@ -40,6 +43,7 @@ int syslog_prio[] = {
 };
 #endif
 int log_priority;
+extern char *whoami;
 
 sms_update_com_err_hook(whoami, code, fmt, args)
     char *whoami;
@@ -90,3 +94,22 @@ sms_update_initialize()
     log_priority = log_INFO;
     initialized = 1;
 }
+
+
+static char fmt[] = "[%s] %s";
+
+#define        def(name,level,prio) \
+    name(msg) \
+    char *msg; \
+{\
+     register int old_prio; \
+     old_prio = log_priority; \
+     sms_update_initialize(); \
+     com_err(whoami, 0, fmt, level, msg); \
+     log_priority = old_prio; \
+}
+
+def(sms_log_error, "error", log_ERROR)
+def(sms_log_warning, "warning", log_WARNING)
+def(sms_log_info, "info", log_INFO)
+def(sms_debug, "debug", log_DEBUG)
This page took 0.094705 seconds and 4 git commands to generate.