Skip to content

Commit

Permalink
pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
Ing-Dom committed Dec 31, 2023
1 parent d108a5b commit e16481e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/knx/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ void KnxLogger::log(const char* message, va_list& values)
return;
}
printf(message, values);
// new line !
}

void KnxLogger::setCallback(KnxLoggerCallback callback)
Expand Down
6 changes: 5 additions & 1 deletion src/knx/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ constexpr uint64_t KNX_LOG_MEM = 0x0012;
constexpr uint64_t LOGLEVEL = KNX_LOG_LVL;
constexpr uint64_t LOGAREAS = KNX_LOG_AREAS;


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++17-extensions"
template<uint64_t x, typename... Args>
__attribute__((always_inline)) constexpr void KNX_LOG_TRACE(Args&&... args)
{
Expand All @@ -86,4 +89,5 @@ template<uint64_t x, typename... Args>
{
if constexpr((LOGLEVEL >= KNX_LOG_LVL_ERROR) && (x & LOGAREAS))
knxLogger.log(std::forward<Args>(args)...);
}
}
#pragma GCC diagnostic pop

0 comments on commit e16481e

Please sign in to comment.