Skip to content

Commit

Permalink
dont use auto parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ing-Dom committed Dec 29, 2023
1 parent 88fe16c commit 2d40692
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/knx/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
#include <utility>


constexpr auto KNX_LOG_LVL_ERROR = 1;
constexpr auto KNX_LOG_LVL_INFO = 2;
constexpr auto KNX_LOG_LVL_DEBUG = 3;
constexpr auto KNX_LOG_LVL_TRACE = 4;
constexpr uint64_t KNX_LOG_LVL_ERROR = 1;
constexpr uint64_t KNX_LOG_LVL_INFO = 2;
constexpr uint64_t KNX_LOG_LVL_DEBUG = 3;
constexpr uint64_t KNX_LOG_LVL_TRACE = 4;


constexpr auto KNX_LOG_LL = 0x0001;
constexpr auto KNX_LOG_NL = 0x0002;
constexpr auto KNX_LOG_TL = 0x0004;
constexpr auto KNX_LOG_AL = 0x0008;
constexpr auto KNX_LOG_TPUART = 0x0010;
constexpr auto KNX_LOG_IP = 0x0011;
constexpr auto KNX_LOG_MEM = 0x0012;
constexpr uint64_t KNX_LOG_LL = 0x0001;
constexpr uint64_t KNX_LOG_NL = 0x0002;
constexpr uint64_t KNX_LOG_TL = 0x0004;
constexpr uint64_t KNX_LOG_AL = 0x0008;
constexpr uint64_t KNX_LOG_TPUART = 0x0010;
constexpr uint64_t KNX_LOG_IP = 0x0011;
constexpr uint64_t KNX_LOG_MEM = 0x0012;


#ifndef KNX_LOG_AREAS
Expand All @@ -39,31 +39,31 @@ constexpr auto KNX_LOG_MEM = 0x0012;
#define KNX_LOG_LVL 0
#endif

constexpr auto LOGLEVEL = KNX_LOG_LVL;
constexpr auto LOGAREAS = KNX_LOG_AREAS;
constexpr uint64_t LOGLEVEL = KNX_LOG_LVL;
constexpr uint64_t LOGAREAS = KNX_LOG_AREAS;

template<auto x, typename... Args>
template<uint64_t x, typename... Args>
__attribute__((always_inline)) constexpr void KNX_LOG_TRACE(Args&&... args)
{
if constexpr((LOGLEVEL >= KNX_LOG_LVL_TRACE) && (x & LOGAREAS))
printf(std::forward<Args>(args)...);
}

template<auto x, typename... Args>
template<uint64_t x, typename... Args>
__attribute__((always_inline)) constexpr void KNX_LOG_DEBUG(Args&&... args)
{
if constexpr((LOGLEVEL >= KNX_LOG_LVL_DEBUG) && (x & LOGAREAS))
printf(std::forward<Args>(args)...);
}

template<auto x, typename... Args>
template<uint64_t x, typename... Args>
__attribute__((always_inline)) constexpr void KNX_LOG_INFO(Args&&... args)
{
if constexpr((LOGLEVEL >= KNX_LOG_LVL_INFO) && (x & LOGAREAS))
printf(std::forward<Args>(args)...);
}

template<auto x, typename... Args>
template<uint64_t x, typename... Args>
__attribute__((always_inline)) constexpr void KNX_LOG_ERROR(Args&&... args)
{
if constexpr((LOGLEVEL >= KNX_LOG_LVL_ERROR) && (x & LOGAREAS))
Expand Down

0 comments on commit 2d40692

Please sign in to comment.