Skip to content

Commit 73b78a1

Browse files
committed
fix warning on ESP32
1 parent e99aef3 commit 73b78a1

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

DebugLogEnable.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
#undef ASSERT
77
#undef ASSERTM
88

9-
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 \
10-
: __FILE__)
11-
#define LOG_ERROR(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_ERROR, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
12-
#define LOG_WARN(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_WARN, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
13-
#define LOG_INFO(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_INFO, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
14-
#define LOG_DEBUG(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_DEBUG, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
15-
#define LOG_TRACE(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_TRACE, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
9+
#define LOG_SHORT_FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
10+
#define LOG_ERROR(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_ERROR, LOG_SHORT_FILENAME, __LINE__, __func__, __VA_ARGS__)
11+
#define LOG_WARN(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_WARN, LOG_SHORT_FILENAME, __LINE__, __func__, __VA_ARGS__)
12+
#define LOG_INFO(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_INFO, LOG_SHORT_FILENAME, __LINE__, __func__, __VA_ARGS__)
13+
#define LOG_DEBUG(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_DEBUG, LOG_SHORT_FILENAME, __LINE__, __func__, __VA_ARGS__)
14+
#define LOG_TRACE(...) DebugLog::Manager::get().log(arx::debug::LogLevel::LVL_TRACE, LOG_SHORT_FILENAME, __LINE__, __func__, __VA_ARGS__)
1615

1716
#ifdef ARDUINO
18-
#define ASSERT(b) DebugLog::Manager::get().assertion((b), __FILENAME__, __LINE__, __func__, #b)
19-
#define ASSERTM(b, msg) DebugLog::Manager::get().assertion((b), __FILENAME__, __LINE__, __func__, #b, msg)
17+
#define ASSERT(b) DebugLog::Manager::get().assertion((b), LOG_SHORT_FILENAME, __LINE__, __func__, #b)
18+
#define ASSERTM(b, msg) DebugLog::Manager::get().assertion((b), LOG_SHORT_FILENAME, __LINE__, __func__, #b, msg)
2019
#else // ARDUINO
2120
#include <cassert>
2221
#define ASSERT(b) assert(b)

0 commit comments

Comments
 (0)