Skip to content

Commit

Permalink
[debug] Make log level switch constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Jun 14, 2020
1 parent f543ecd commit f593960
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modm/debug/logger/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,39 +87,39 @@ namespace modm
* \ingroup modm_debug
*/
#define MODM_LOG_OFF \
if ( true ){} \
if constexpr ( true ){} \
else modm::log::debug

/**
* \brief Output stream for debug messages
* \ingroup modm_debug
*/
#define MODM_LOG_DEBUG \
if (MODM_LOG_LEVEL > modm::log::DEBUG){} \
if constexpr (MODM_LOG_LEVEL > modm::log::DEBUG){} \
else modm::log::debug

/**
* \brief Output stream for info messages
* \ingroup modm_debug
*/
#define MODM_LOG_INFO \
if (MODM_LOG_LEVEL > modm::log::INFO){} \
if constexpr (MODM_LOG_LEVEL > modm::log::INFO){} \
else modm::log::info

/**
* \brief Output stream for warnings
* \ingroup modm_debug
*/
#define MODM_LOG_WARNING \
if (MODM_LOG_LEVEL > modm::log::WARNING){} \
if constexpr (MODM_LOG_LEVEL > modm::log::WARNING){} \
else modm::log::warning

/**
* \brief Output stream for error messages
* \ingroup modm_debug
*/
#define MODM_LOG_ERROR \
if (MODM_LOG_LEVEL > modm::log::ERROR){} \
if constexpr (MODM_LOG_LEVEL > modm::log::ERROR){} \
else modm::log::error

#ifdef __DOXYGEN__
Expand Down

0 comments on commit f593960

Please sign in to comment.