Update loglevels.hpp (#496)

This commit is contained in:
CryptoManiac 2023-05-20 16:16:32 +03:00 committed by GitHub
parent bad9c58e60
commit 7817fd3a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,9 +35,6 @@ struct LEVELS {
LEVELS(const LEVELS& other): value(other.value), text(other.text.c_str()) {} LEVELS(const LEVELS& other): value(other.value), text(other.text.c_str()) {}
#if __cplusplus >= 202002L
constexpr
#endif
LEVELS(int id, const std::string& idtext) : value(id), text(idtext) {} LEVELS(int id, const std::string& idtext) : value(id), text(idtext) {}
bool operator==(const LEVELS& rhs) const { bool operator==(const LEVELS& rhs) const {
@ -94,12 +91,7 @@ namespace g3 {
static const int kInternalFatalValue = 2000; static const int kInternalFatalValue = 2000;
} // g3 } // g3
#if __cplusplus >= 202002L const LEVELS G3LOG_DEBUG{g3::kDebugValue, "DEBUG"},
constexpr
#else
const
#endif
LEVELS G3LOG_DEBUG{g3::kDebugValue, "DEBUG"},
INFO {g3::kInfoValue, "INFO"}, INFO {g3::kInfoValue, "INFO"},
WARNING {g3::kWarningValue, "WARNING"}, WARNING {g3::kWarningValue, "WARNING"},
FATAL {g3::kFatalValue, "FATAL"}; FATAL {g3::kFatalValue, "FATAL"};
@ -137,12 +129,7 @@ namespace g3 {
namespace g3 { namespace g3 {
namespace internal { namespace internal {
#if __cplusplus >= 202002L const LEVELS CONTRACT {g3::kInternalFatalValue, {"CONTRACT"}},
constexpr
#else
const
#endif
LEVELS CONTRACT {g3::kInternalFatalValue, {"CONTRACT"}},
FATAL_SIGNAL {g3::kInternalFatalValue + 1, {"FATAL_SIGNAL"}}, FATAL_SIGNAL {g3::kInternalFatalValue + 1, {"FATAL_SIGNAL"}},
FATAL_EXCEPTION {kInternalFatalValue + 2, {"FATAL_EXCEPTION"}}; FATAL_EXCEPTION {kInternalFatalValue + 2, {"FATAL_EXCEPTION"}};