From fbc252701ac409e1e9cb4623317b44bc914e16d0 Mon Sep 17 00:00:00 2001 From: okaestne Date: Thu, 20 Oct 2022 01:57:59 +0200 Subject: [PATCH] add braces --- Log.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Log.cpp b/Log.cpp index f11e26e..a46fc40 100644 --- a/Log.cpp +++ b/Log.cpp @@ -78,10 +78,11 @@ private: if (os) { // print colors if enabled - if (coloredOutput) + if (coloredOutput) { *os << "\x1B[" << color_codes[static_cast(lvl)] << sbuf << "\x1B[0m"; - else + } else { *os << sbuf; + } os->put('\n'); } @@ -89,14 +90,16 @@ private: virtual std::ostream* getOs(Level lvl) { // out of scope? - if (lvl == Level::off || lvl > lvl_max) + if (lvl == Level::off || lvl > lvl_max) { return nullptr; + } // stderr for fatal, error, warn - if (lvl <= Level::warn) + if (lvl <= Level::warn) { return osErr; - else + } else { return osStd; + } } }; @@ -121,8 +124,9 @@ private: #endif virtual std::ostream* getOs(Level lvl) { - if (lvl_min <= lvl && lvl <= lvl_max) + if (lvl_min <= lvl && lvl <= lvl_max) { return &ofs; + } return nullptr; } }; @@ -185,8 +189,9 @@ std::ostream& defaultEntryMetaLevel(std::ostream& os, const Entry& e) { void init() { // add default console logger - if (outputs.empty()) + if (outputs.empty()) { outputs.push_back(std::unique_ptr(new ConsoleOutput())); + } // set default entry metadata printing functions auto space = [](std::ostream& os, const Entry& e) -> std::ostream& {