summaryrefslogtreecommitdiff
path: root/logging.h
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-02-11 22:10:26 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:26 -0700
commit51a8bb2f361d86013e7579570faba446eed9c66d (patch)
treee2ac4dc12e0608edec3731f1764873958b835add /logging.h
parent4d803d8d04a8493f8efc039c7789c65be33048a0 (diff)
[PATCH] fix log option code so that it actually works for all udev programs.
Also introduce boolean type for config file to use.
Diffstat (limited to 'logging.h')
-rw-r--r--logging.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/logging.h b/logging.h
index 5ae228b139..df0d7dedce 100644
--- a/logging.h
+++ b/logging.h
@@ -34,9 +34,6 @@
#include <unistd.h>
#include <syslog.h>
-#include "udev.h"
-#include "udev_version.h"
-
#undef info
#define info(format, arg...) \
do { \
@@ -60,13 +57,17 @@
} while (0)
#endif
+/* each program must declare this variable and function somewhere */
+extern unsigned char logname[42];
+extern int log_ok(void);
+
static void log_message (int level, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
static inline void log_message (int level, const char *format, ...)
{
va_list args;
- if (0 != strncmp(udev_log_str, UDEV_LOG_DEFAULT, BOOL_SIZE))
+ if (!log_ok())
return;
va_start(args, format);
@@ -74,9 +75,6 @@ static inline void log_message (int level, const char *format, ...)
va_end(args);
}
-/* each program must declare this variable somewhere */
-extern unsigned char logname[42];
-
#undef init_logging
static inline void init_logging(char *program_name)
{