mirror of
https://github.com/FairRootGroup/FairLogger.git
synced 2025-10-13 16:46:46 +00:00
Logger: output only to stdout
This commit is contained in:
parent
e32efc489d
commit
a35a4f48a8
|
@ -124,7 +124,6 @@ class ColoredSeverityWriter
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Logger::fColored = false;
|
bool Logger::fColored = false;
|
||||||
bool Logger::fCerrOnly = false;
|
|
||||||
fstream Logger::fFileStream;
|
fstream Logger::fFileStream;
|
||||||
Logger::Verbosity Logger::fVerbosity = Logger::Verbosity::low;
|
Logger::Verbosity Logger::fVerbosity = Logger::Verbosity::low;
|
||||||
Logger::Severity Logger::fConsoleSeverity = Logger::Severity::info;
|
Logger::Severity Logger::fConsoleSeverity = Logger::Severity::info;
|
||||||
|
@ -441,11 +440,6 @@ void Logger::OnFatal(std::function<void()> func)
|
||||||
fFatalCallback = func;
|
fFatalCallback = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logger::SetCerrOnly(bool cerrOnly)
|
|
||||||
{
|
|
||||||
fCerrOnly = cerrOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger::~Logger() noexcept(false)
|
Logger::~Logger() noexcept(false)
|
||||||
{
|
{
|
||||||
fContent << "\n"; // "\n" + flush instead of endl makes output thread safe.
|
fContent << "\n"; // "\n" + flush instead of endl makes output thread safe.
|
||||||
|
@ -457,25 +451,11 @@ Logger::~Logger() noexcept(false)
|
||||||
if (fColored)
|
if (fColored)
|
||||||
{
|
{
|
||||||
fColorOut << fContent.str();
|
fColorOut << fContent.str();
|
||||||
if (fCurrentSeverity == Severity::fatal || fCurrentSeverity == Severity::error || fCerrOnly)
|
cout << fColorOut.str() << flush;
|
||||||
{
|
|
||||||
cerr << fColorOut.str() << flush;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cout << fColorOut.str() << flush;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fCurrentSeverity == Severity::fatal || fCurrentSeverity == Severity::error || fCerrOnly)
|
cout << fBWOut.str() << flush;
|
||||||
{
|
|
||||||
cerr << fBWOut.str() << flush;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cout << fBWOut.str() << flush;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,8 +127,6 @@ class Logger
|
||||||
|
|
||||||
static void OnFatal(std::function<void()> func);
|
static void OnFatal(std::function<void()> func);
|
||||||
|
|
||||||
static void SetCerrOnly(bool cerrOnly);
|
|
||||||
|
|
||||||
virtual ~Logger() noexcept(false);
|
virtual ~Logger() noexcept(false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -139,7 +137,6 @@ class Logger
|
||||||
std::ostringstream fBWOut;
|
std::ostringstream fBWOut;
|
||||||
static const std::string fProcessName;
|
static const std::string fProcessName;
|
||||||
static bool fColored;
|
static bool fColored;
|
||||||
static bool fCerrOnly;
|
|
||||||
static std::fstream fFileStream;
|
static std::fstream fFileStream;
|
||||||
|
|
||||||
static Severity fConsoleSeverity;
|
static Severity fConsoleSeverity;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user