]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Prefix loglevel macros with "LL_".
authorAndre Noll <maan@systemlinux.org>
Thu, 15 Jan 2009 17:47:53 +0000 (18:47 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 15 Jan 2009 17:47:53 +0000 (18:47 +0100)
audiod.c
gui.c
para.h
server.c

index fc4ac6f5017b2eb5c4876d0c29a0bd53ba512b8f..12aa9d7a88916b42a59fdd7fbeb14be3b9583dbb 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -207,7 +207,7 @@ __printf_2_3 void para_log(int ll, const char* fmt,...)
        tm = localtime(&t1);
        strftime(str, MAXLINE, "%b %d %H:%M:%S", tm);
        fprintf(outfd, "%s %s ", str, hostname);
-       if (conf.loglevel_arg <= INFO)
+       if (conf.loglevel_arg <= LL_INFO)
                fprintf(outfd, "%i ", ll);
        va_start(argp, fmt);
        vfprintf(outfd, fmt, argp);
diff --git a/gui.c b/gui.c
index 982f68844b9311b464b4820b158ea7e5adec1fc1..f08976d2575d96afca710fb5d0b7b4bdd9246ab4 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -497,9 +497,9 @@ __printf_2_3 void para_log(int ll, const char *fmt,...)
        if (ll < conf.loglevel_arg || !curses_active)
                return;
        switch (ll) {
-               case DEBUG:
-               case INFO:
-               case NOTICE:
+               case LL_DEBUG:
+               case LL_INFO:
+               case LL_NOTICE:
                        color = COLOR_MSG;
                        break;
                default:
@@ -563,7 +563,7 @@ __noreturn __printf_2_3 static void msg_n_exit(int ret, const char* fmt, ...)
 static void print_welcome(void)
 {
        int ll = conf.loglevel_arg;
-       if (ll > NOTICE)
+       if (ll > LL_NOTICE)
                return;
        outputf(COLOR_WELCOME, "Welcome to para_gui " PACKAGE_VERSION
                " \"" CODENAME "\". Theme: %s", theme.name);
@@ -1168,7 +1168,7 @@ err_out:
 
 static void com_ll_decr(void)
 {
-       if (conf.loglevel_arg <= DEBUG) {
+       if (conf.loglevel_arg <= LL_DEBUG) {
                print_in_bar(COLOR_ERRMSG,
                        "loglevel already at maximal verbosity\n");
                return;
@@ -1179,7 +1179,7 @@ static void com_ll_decr(void)
 
 static void com_ll_incr(void)
 {
-       if (conf.loglevel_arg >= EMERG) {
+       if (conf.loglevel_arg >= LL_EMERG) {
                print_in_bar(COLOR_ERRMSG,
                        "loglevel already at miminal verbosity\n");
                return;
diff --git a/para.h b/para.h
index f456eebd4e6fa37224e915aacd9d10131c24a798..4022bec7a90019084f7e326d99f236735788f9d3 100644 (file)
--- a/para.h
+++ b/para.h
        typeof(x) _x = (x); \
        _x > 0? _x : -_x; })
 
-/** debug loglevel, gets really noisy */
-#define DEBUG 1
-/** still noisy, but won't fill your disk */
-#define INFO  2
-/** normal, but significant event */
-#define NOTICE 3
-/** unexpected event that can be handled */
-#define WARNING 4
-/** unhandled error condition */
-#define ERROR 5
-/** system might be unreliable */
-#define CRIT 6
-/** last message before exit */
-#define EMERG 7
+/** Debug loglevel, gets really noisy. */
+#define LL_DEBUG 1
+/** Still noisy, but won't fill your disk. */
+#define LL_INFO  2
+/** Normal, but significant event. */
+#define LL_NOTICE 3
+/** Unexpected event that can be handled. */
+#define LL_WARNING 4
+/** Unhandled error condition. */
+#define LL_ERROR 5
+/** System might be unreliable. */
+#define LL_CRIT 6
+/** Last message before exit. */
+#define LL_EMERG 7
 
 /** Log messages with lower priority than that will not be compiled in. */
 #define COMPILE_TIME_LOGLEVEL 0
 
 /** \cond */
-#if DEBUG > COMPILE_TIME_LOGLEVEL
-#define PARA_DEBUG_LOG(f,...) para_log(DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#if LL_DEBUG > COMPILE_TIME_LOGLEVEL
+#define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_DEBUG_LOG(...) do {;} while (0)
 #endif
 
-#if INFO > COMPILE_TIME_LOGLEVEL
-#define PARA_INFO_LOG(f,...) para_log(INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#if LL_INFO > COMPILE_TIME_LOGLEVEL
+#define PARA_INFO_LOG(f,...) para_log(LL_INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_INFO_LOG(...) do {;} while (0)
 #endif
 
-#if NOTICE > COMPILE_TIME_LOGLEVEL
-#define PARA_NOTICE_LOG(f,...) para_log(NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#if LL_NOTICE > COMPILE_TIME_LOGLEVEL
+#define PARA_NOTICE_LOG(f,...) para_log(LL_NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_NOTICE_LOG(...) do {;} while (0)
 #endif
 
-#if WARNING > COMPILE_TIME_LOGLEVEL
-#define PARA_WARNING_LOG(f,...) para_log(WARNING, "%s: " f, __FUNCTION__, ##  __VA_ARGS__)
+#if LL_WARNING > COMPILE_TIME_LOGLEVEL
+#define PARA_WARNING_LOG(f,...) para_log(LL_WARNING, "%s: " f, __FUNCTION__, ##  __VA_ARGS__)
 #else
 #define PARA_WARNING_LOG(...) do {;} while (0)
 #endif
 
-#if ERROR > COMPILE_TIME_LOGLEVEL
-#define PARA_ERROR_LOG(f,...) para_log(ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#if LL_ERROR > COMPILE_TIME_LOGLEVEL
+#define PARA_ERROR_LOG(f,...) para_log(LL_ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_ERROR_LOG(...) do {;} while (0)
 #endif
 
-#if CRIT > COMPILE_TIME_LOGLEVEL
-#define PARA_CRIT_LOG(f,...) para_log(CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#if LL_CRIT > COMPILE_TIME_LOGLEVEL
+#define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_CRIT_LOG(...) do {;} while (0)
 #endif
 
-#if EMERG > COMPILE_TIME_LOGLEVEL
-#define PARA_EMERG_LOG(f,...) para_log(EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#if LL_EMERG > COMPILE_TIME_LOGLEVEL
+#define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
 #else
 #define PARA_EMERG_LOG(...)
 #endif
index 2c2f31c1d08b0d84bb8d8bc44649bf827b5cbfd9..c9400e9cdcdde5dfa9ec9cdcf0f0b27bbd09a4f8 100644 (file)
--- a/server.c
+++ b/server.c
@@ -153,10 +153,10 @@ __printf_2_3 void para_log(int ll, const char* fmt,...)
        tm = localtime(&t1);
        strftime(str, MAXLINE, "%b %d %H:%M:%S", tm);
        fprintf(outfd, "%s ", str);
-       if (conf.loglevel_arg <= INFO)
+       if (conf.loglevel_arg <= LL_INFO)
                fprintf(outfd, "%i: ", ll);
        mypid = getpid();
-       if (conf.loglevel_arg <= INFO)
+       if (conf.loglevel_arg <= LL_INFO)
                fprintf(outfd, "(%d) ", (int)mypid);
        va_start(argp, fmt);
        vfprintf(outfd, fmt, argp);