about summary refs log tree commit diff
path: root/src/libutil/logging.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-06-17T07·12+0200
committerEelco Dolstra <edolstra@gmail.com>2019-06-25T10·44+0200
commit5600b070a766b83200a68d3632793917cf19a550 (patch)
treef0b429880e73624d6063a961559728c5a890f6a7 /src/libutil/logging.cc
parent64ec087f582cec33733f4102ab42a3e8f291758a (diff)
Add "warning" verbosity level
This ensures that "nix" shows warnings. Previously these were hidden
because they were at "info" level.

(cherry picked from commit 615a9d031d22a6aee64f8511e15685e47b6f8796)
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r--src/libutil/logging.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 799c6e1ae441..b379306f6ec0 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -21,7 +21,7 @@ Logger * logger = makeDefaultLogger();
 
 void Logger::warn(const std::string & msg)
 {
-    log(lvlInfo, ANSI_RED "warning:" ANSI_NORMAL " " + msg);
+    log(lvlWarn, ANSI_RED "warning:" ANSI_NORMAL " " + msg);
 }
 
 class SimpleLogger : public Logger
@@ -46,6 +46,7 @@ public:
             char c;
             switch (lvl) {
             case lvlError: c = '3'; break;
+            case lvlWarn: c = '4'; break;
             case lvlInfo: c = '5'; break;
             case lvlTalkative: case lvlChatty: c = '6'; break;
             default: c = '7';