mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-02-02 20:41:40 +01:00
feat(Log): Add macros for conditional log print and rc handling
This commit is contained in:
parent
459e8c9fcd
commit
5490cef129
1 changed files with 12 additions and 5 deletions
|
@ -172,5 +172,12 @@
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# endif /* CONFIG_NIMBLE_CPP_IDF */
|
# endif /* CONFIG_NIMBLE_CPP_IDF */
|
||||||
|
|
||||||
|
# define NIMBLE_LOGD_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGD(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGI_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGI(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGW_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGW(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGE_IF(cond, tag, format, ...) { if (cond) { NIMBLE_LOGE(tag, format, ##__VA_ARGS__); }}
|
||||||
|
# define NIMBLE_LOGE_RC(rc, tag, format, ...) { if (rc) { NIMBLE_LOGE(tag, format "; rc=%d %s", ##__VA_ARGS__, rc, NimBLEUtils::returnCodeToString(rc)); }}
|
||||||
|
|
||||||
#endif /* CONFIG_BT_ENABLED */
|
#endif /* CONFIG_BT_ENABLED */
|
||||||
#endif /* NIMBLE_CPP_LOG_H_ */
|
#endif /* NIMBLE_CPP_LOG_H_ */
|
Loading…
Add table
Reference in a new issue