chiark / gitweb /
logind: minor clean-ups
[elogind.git] / src / basic / log.c
index 5a702112f7c3af57a3b450e5dab12d5b90731e98..c6f70a1878f0f139a8423b8e01428265142ad405 100644 (file)
@@ -27,8 +27,8 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <stddef.h>
-#include <printf.h>
 
+#include "parse-printf-format.h"
 #include "sd-messages.h"
 #include "log.h"
 #include "util.h"
@@ -351,10 +351,10 @@ static int write_to_console(
         }
 
         if (highlight)
-                IOVEC_SET_STRING(iovec[n++], ANSI_HIGHLIGHT_RED_ON);
+                IOVEC_SET_STRING(iovec[n++], ANSI_HIGHLIGHT_RED);
         IOVEC_SET_STRING(iovec[n++], buffer);
         if (highlight)
-                IOVEC_SET_STRING(iovec[n++], ANSI_HIGHLIGHT_OFF);
+                IOVEC_SET_STRING(iovec[n++], ANSI_NORMAL);
         IOVEC_SET_STRING(iovec[n++], "\n");
 
         if (writev(console_fd, iovec, n) < 0) {
@@ -942,7 +942,7 @@ int log_set_max_level_from_string(const char *e) {
 
         t = log_level_from_string(e);
         if (t < 0)
-                return t;
+                return -EINVAL;
 
         log_set_max_level(t);
         return 0;