Add warn log level
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 16 Mar 2020 18:42:07 +0000 (14:42 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 16 Mar 2020 18:42:07 +0000 (14:42 -0400)
x5/khatus.c

index db800ea..bb76507 100644 (file)
@@ -17,6 +17,7 @@
 
 #define debug(args...) if (cfg->log_level >= Debug) {fprintf(stderr, "[debug] " args); fflush(stderr);}
 #define info( args...) if (cfg->log_level >= Info ) {fprintf(stderr, "[info] "  args); fflush(stderr);}
+#define warn( args...) if (cfg->log_level >= Warn ) {fprintf(stderr, "[warn] "  args); fflush(stderr);}
 #define error(args...) if (cfg->log_level >= Error) {fprintf(stderr, "[error] " args); fflush(stderr);}
 #define fatal(args...) {fprintf(stderr, "[fatal] " args); exit(EXIT_FAILURE);}
 #define usage(args...) {print_usage(); fatal("[usage] " args);}
@@ -31,6 +32,7 @@ char *argv0;
 typedef enum LogLevel {
        Nothing,
        Error,
+       Warn,
        Info,
        Debug
 } LogLevel;
@@ -392,7 +394,7 @@ snooze(struct timespec *t, Config *cfg)
 
        if (result < 0) {
                if (errno == EINTR) {
-                       info(
+                       warn(
                            "nanosleep interrupted. Remainder: "
                            "{ tv_sec = %ld, tv_nsec = %ld }",
                            remainder.tv_sec, remainder.tv_nsec);
This page took 0.027396 seconds and 4 git commands to generate.