add braces
This commit is contained in:
parent
105aac9451
commit
fbc252701a
19
Log.cpp
19
Log.cpp
|
@ -78,10 +78,11 @@ private:
|
|||
|
||||
if (os) {
|
||||
// print colors if enabled
|
||||
if (coloredOutput)
|
||||
if (coloredOutput) {
|
||||
*os << "\x1B[" << color_codes[static_cast<int>(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<Output>(new ConsoleOutput()));
|
||||
}
|
||||
|
||||
// set default entry metadata printing functions
|
||||
auto space = [](std::ostream& os, const Entry& e) -> std::ostream& {
|
||||
|
|
Loading…
Reference in New Issue