OGLplus  (0.59.0) a C++ wrapper for rendering APIs

config.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_LOGGING_CONFIG_HPP
10 #define EAGINE_LOGGING_CONFIG_HPP
11 
12 #include "../config/basic.hpp"
13 #include "../int_constant.hpp"
14 #include "severity.hpp"
15 
16 namespace eagine {
17 //------------------------------------------------------------------------------
18 #ifndef EAGINE_MIN_LOG_SEVERITY
19 #if EAGINE_LOW_PROFILE
20 #define EAGINE_MIN_LOG_SEVERITY warning
21 #else
22 #if EAGINE_DEBUG
23 #define EAGINE_MIN_LOG_SEVERITY trace
24 #else
25 #define EAGINE_MIN_LOG_SEVERITY stat
26 #endif
27 #endif
28 #endif
29 //------------------------------------------------------------------------------
32 template <log_event_severity severity>
34  std::integral_constant<log_event_severity, severity>;
35 //------------------------------------------------------------------------------
38 using min_log_severity_t =
40 //------------------------------------------------------------------------------
45 template <log_event_severity severity>
47  bool_constant<(severity >= min_log_severity_t::value)>;
48 
52 template <log_event_severity severity>
53 static constexpr const bool is_log_level_enabled_v =
55 //------------------------------------------------------------------------------
59 static constexpr auto is_log_level_enabled(log_event_severity severity) noexcept
60  -> bool {
61  return (severity >= min_log_severity_t::value);
62 }
63 //------------------------------------------------------------------------------
64 } // namespace eagine
65 
66 #endif // EAGINE_LOGGING_CONFIG_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
static constexpr auto is_log_level_enabled(log_event_severity severity) noexcept -> bool
Function indicating if the specified log severity is enabled.
Definition: config.hpp:59
bool_constant<(severity >=min_log_severity_t::value)> is_log_level_enabled_t
Compile-time trait indicating if the specified log severity is enabled.
Definition: config.hpp:47
static constexpr const bool is_log_level_enabled_v
Compile-time trait indicating if the specified log severity is enabled.
Definition: config.hpp:53
std::integral_constant< bool, B > bool_constant
Alias for boolean constant type.
Definition: int_constant.hpp:20
std::integral_constant< log_event_severity, severity > log_event_severity_constant
Type alias for log event severity constants.
Definition: config.hpp:34
log_event_severity
Log event severity enumeration.
Definition: severity.hpp:18
log_event_severity_constant< log_event_severity::EAGINE_MIN_LOG_SEVERITY > min_log_severity_t
The minimal log severity constant.
Definition: config.hpp:39

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).