mirror of
https://github.com/FairRootGroup/FairLogger.git
synced 2025-10-13 08:41:12 +00:00
Compare commits
No commits in common. "27527ad87b63213b7c58caf1e34a538e76f273da" and "0ae9a697b4643b829b139b6025b8238b24cc42e7" have entirely different histories.
27527ad87b
...
0ae9a697b4
|
@ -1,5 +1,5 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
# Copyright (C) 2018-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
|
# Copyright (C) 2018-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
|
||||||
# #
|
# #
|
||||||
# This software is distributed under the terms of the #
|
# This software is distributed under the terms of the #
|
||||||
# GNU Lesser General Public Licence (LGPL) version 3, #
|
# GNU Lesser General Public Licence (LGPL) version 3, #
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.9.4 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.9.4 FATAL_ERROR)
|
||||||
cmake_policy(VERSION 3.9...3.30)
|
cmake_policy(VERSION 3.9...3.19)
|
||||||
|
|
||||||
# Project ######################################################################
|
# Project ######################################################################
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||||
|
|
|
@ -100,7 +100,6 @@ where severity level is one of the following:
|
||||||
"important",
|
"important",
|
||||||
"alarm",
|
"alarm",
|
||||||
"error",
|
"error",
|
||||||
"critical",
|
|
||||||
"fatal",
|
"fatal",
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (C) 2014-2025 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
* Copyright (C) 2014-2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
* *
|
* *
|
||||||
* This software is distributed under the terms of the *
|
* This software is distributed under the terms of the *
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
|
@ -69,7 +69,6 @@ const unordered_map<string_view, Severity> Logger::fSeverityMap =
|
||||||
{ {"NOLOG"}, Severity::nolog },
|
{ {"NOLOG"}, Severity::nolog },
|
||||||
{ {"fatal"}, Severity::fatal },
|
{ {"fatal"}, Severity::fatal },
|
||||||
{ {"FATAL"}, Severity::fatal },
|
{ {"FATAL"}, Severity::fatal },
|
||||||
{ {"critical"}, Severity::critical },
|
|
||||||
{ {"error"}, Severity::error },
|
{ {"error"}, Severity::error },
|
||||||
{ {"ERROR"}, Severity::error },
|
{ {"ERROR"}, Severity::error },
|
||||||
{ {"alarm"}, Severity::alarm },
|
{ {"alarm"}, Severity::alarm },
|
||||||
|
@ -97,7 +96,7 @@ const unordered_map<string_view, Severity> Logger::fSeverityMap =
|
||||||
{ {"TRACE"}, Severity::trace }
|
{ {"TRACE"}, Severity::trace }
|
||||||
};
|
};
|
||||||
|
|
||||||
const array<string_view, 16> Logger::fSeverityNames =
|
const array<string_view, 15> Logger::fSeverityNames =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"NOLOG",
|
"NOLOG",
|
||||||
|
@ -114,7 +113,6 @@ const array<string_view, 16> Logger::fSeverityNames =
|
||||||
"IMPORTANT",
|
"IMPORTANT",
|
||||||
"ALARM",
|
"ALARM",
|
||||||
"ERROR",
|
"ERROR",
|
||||||
"CRITICAL",
|
|
||||||
"FATAL"
|
"FATAL"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -291,7 +289,6 @@ string Logger::GetColoredSeverityString(Severity severity)
|
||||||
switch (severity) {
|
switch (severity) {
|
||||||
case Severity::nolog: return "\033[01;39mNOLOG\033[0m"; break;
|
case Severity::nolog: return "\033[01;39mNOLOG\033[0m"; break;
|
||||||
case Severity::fatal: return "\033[01;31mFATAL\033[0m"; break;
|
case Severity::fatal: return "\033[01;31mFATAL\033[0m"; break;
|
||||||
case Severity::critical: return "\033[01;31mCRITICAL\033[0m"; break;
|
|
||||||
case Severity::error: return "\033[01;31mERROR\033[0m"; break;
|
case Severity::error: return "\033[01;31mERROR\033[0m"; break;
|
||||||
case Severity::alarm: return "\033[01;33mALARM\033[0m"; break;
|
case Severity::alarm: return "\033[01;33mALARM\033[0m"; break;
|
||||||
case Severity::important: return "\033[01;32mIMPORTANT\033[0m"; break;
|
case Severity::important: return "\033[01;32mIMPORTANT\033[0m"; break;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (C) 2014-2025 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
* Copyright (C) 2014-2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
* *
|
* *
|
||||||
* This software is distributed under the terms of the *
|
* This software is distributed under the terms of the *
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
|
@ -67,8 +67,7 @@ enum class Severity : int
|
||||||
important = 11,
|
important = 11,
|
||||||
alarm = 12,
|
alarm = 12,
|
||||||
error = 13,
|
error = 13,
|
||||||
critical = 14,
|
fatal = 14,
|
||||||
fatal = 15,
|
|
||||||
// aliases
|
// aliases
|
||||||
warning = warn,
|
warning = warn,
|
||||||
// backwards-compatibility
|
// backwards-compatibility
|
||||||
|
@ -326,7 +325,7 @@ class Logger
|
||||||
|
|
||||||
static const std::unordered_map<std::string_view, Verbosity> fVerbosityMap;
|
static const std::unordered_map<std::string_view, Verbosity> fVerbosityMap;
|
||||||
static const std::unordered_map<std::string_view, Severity> fSeverityMap;
|
static const std::unordered_map<std::string_view, Severity> fSeverityMap;
|
||||||
static const std::array<std::string_view, 16> fSeverityNames;
|
static const std::array<std::string_view, 15> fSeverityNames;
|
||||||
static const std::array<std::string_view, 9> fVerbosityNames;
|
static const std::array<std::string_view, 9> fVerbosityNames;
|
||||||
|
|
||||||
// protection for use after static destruction took place
|
// protection for use after static destruction took place
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (C) 2015-2025 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
* Copyright (C) 2015-2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||||
* *
|
* *
|
||||||
* This software is distributed under the terms of the *
|
* This software is distributed under the terms of the *
|
||||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||||
|
@ -38,7 +38,7 @@ int main()
|
||||||
Logger::SetConsoleSeverity(Severity::fatal);
|
Logger::SetConsoleSeverity(Severity::fatal);
|
||||||
cout << "initial severity >" << Logger::GetConsoleSeverity() << "<" << endl << endl;
|
cout << "initial severity >" << Logger::GetConsoleSeverity() << "<" << endl << endl;
|
||||||
|
|
||||||
array<Severity, 16> severitiesUp{{ Severity::nolog, Severity::trace, Severity::debug4, Severity::debug3, Severity::debug2, Severity::debug1, Severity::debug, Severity::detail, Severity::info, Severity::state, Severity::warn, Severity::important, Severity::alarm, Severity::error, Severity::critical, Severity::fatal }};
|
array<Severity, 15> severitiesUp{{ Severity::nolog, Severity::trace, Severity::debug4, Severity::debug3, Severity::debug2, Severity::debug1, Severity::debug, Severity::detail, Severity::info, Severity::state, Severity::warn, Severity::important, Severity::alarm, Severity::error, Severity::fatal }};
|
||||||
#ifdef FAIR_MIN_SEVERITY
|
#ifdef FAIR_MIN_SEVERITY
|
||||||
for (unsigned int i = static_cast<int>(Severity::FAIR_MIN_SEVERITY); i < severitiesUp.size(); ++i) {
|
for (unsigned int i = static_cast<int>(Severity::FAIR_MIN_SEVERITY); i < severitiesUp.size(); ++i) {
|
||||||
#else
|
#else
|
||||||
|
@ -57,7 +57,7 @@ int main()
|
||||||
Logger::SetConsoleSeverity(Severity::fatal);
|
Logger::SetConsoleSeverity(Severity::fatal);
|
||||||
cout << "initial severity >" << Logger::GetConsoleSeverity() << "<" << endl << endl;
|
cout << "initial severity >" << Logger::GetConsoleSeverity() << "<" << endl << endl;
|
||||||
|
|
||||||
array<Severity, 16> severitiesDown{{ Severity::critical, Severity::error, Severity::alarm, Severity::important, Severity::warn, Severity::state, Severity::info, Severity::detail, Severity::debug, Severity::debug1, Severity::debug2, Severity::debug3, Severity::debug4, Severity::trace, Severity::nolog, Severity::fatal }};
|
array<Severity, 15> severitiesDown{{ Severity::error, Severity::alarm, Severity::important, Severity::warn, Severity::state, Severity::info, Severity::detail, Severity::debug, Severity::debug1, Severity::debug2, Severity::debug3, Severity::debug4, Severity::trace, Severity::nolog, Severity::fatal }};
|
||||||
#ifdef FAIR_MIN_SEVERITY
|
#ifdef FAIR_MIN_SEVERITY
|
||||||
for (unsigned int i = 0; i < severitiesDown.size() - static_cast<int>(Severity::FAIR_MIN_SEVERITY) - 1; ++i) {
|
for (unsigned int i = 0; i < severitiesDown.size() - static_cast<int>(Severity::FAIR_MIN_SEVERITY) - 1; ++i) {
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -31,7 +31,6 @@ void printEverySeverity()
|
||||||
LOG(important) << "important message, counter: " << i++;
|
LOG(important) << "important message, counter: " << i++;
|
||||||
LOG(alarm) << "alarm message, counter: " << i++;
|
LOG(alarm) << "alarm message, counter: " << i++;
|
||||||
LOG(error) << "error message, counter: " << i++;
|
LOG(error) << "error message, counter: " << i++;
|
||||||
LOG(critical) << "critical message, counter: " << i++;
|
|
||||||
LOG(fatal) << "fatal message, counter: " << i++;
|
LOG(fatal) << "fatal message, counter: " << i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ void printEverySeverity()
|
||||||
LOG(important) << "important message ";
|
LOG(important) << "important message ";
|
||||||
LOG(alarm) << "alarm message ";
|
LOG(alarm) << "alarm message ";
|
||||||
LOG(error) << "error message ";
|
LOG(error) << "error message ";
|
||||||
LOG(critical) << "critical message ";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void silentlyPrintAllVerbositiesWithSeverity(Severity sev)
|
void silentlyPrintAllVerbositiesWithSeverity(Severity sev)
|
||||||
|
|
|
@ -34,7 +34,6 @@ uint32_t printEverySeverity(uint32_t i)
|
||||||
LOG(important) << "important message, counter: " << i++;
|
LOG(important) << "important message, counter: " << i++;
|
||||||
LOG(alarm) << "alarm message, counter: " << i++;
|
LOG(alarm) << "alarm message, counter: " << i++;
|
||||||
LOG(error) << "error message, counter: " << i++;
|
LOG(error) << "error message, counter: " << i++;
|
||||||
LOG(critical) << "critical message, counter: " << i++;
|
|
||||||
LOG(fatal) << "fatal message, counter: " << i++;
|
LOG(fatal) << "fatal message, counter: " << i++;
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user