summaryrefslogtreecommitdiff
path: root/libmisc
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-08 22:47:40 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:43 -0700
commit3ce5d9b3a882d160e2b297308ef5237bb062ce1c (patch)
tree16433f5ae6b3eed4947e22459abb7904386189cc /libmisc
parent063f263f84d517c6497e7ca37f503956bad7075a (diff)
libhw: Separate w5500_ll.h logging from w5500.c logging
Diffstat (limited to 'libmisc')
-rw-r--r--libmisc/include/libmisc/log.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/libmisc/include/libmisc/log.h b/libmisc/include/libmisc/log.h
index c1e4a05..b4f5461 100644
--- a/libmisc/include/libmisc/log.h
+++ b/libmisc/include/libmisc/log.h
@@ -25,10 +25,14 @@
[[format(printf, 1, 2)]] int _log_printf(const char *format, ...);
-#define errorf(fmt, ...) do { _log_printf("error: " _LOG_STR(LOG_NAME) ": " fmt "\n" __VA_OPT__(,) __VA_ARGS__); } while (0)
-#define infof(fmt, ...) do { _log_printf("info : " _LOG_STR(LOG_NAME) ": " fmt "\n" __VA_OPT__(,) __VA_ARGS__); } while (0)
-#define debugf(fmt, ...) do { if (_LOG_CAT3(CONFIG_, LOG_NAME, _DEBUG) && !_LOG_NDEBUG) \
- _log_printf("debug: " _LOG_STR(LOG_NAME) ": " fmt "\n" __VA_OPT__(,) __VA_ARGS__); } while (0)
+#define n_errorf(nam, fmt, ...) do { _log_printf("error: " _LOG_STR(nam) ": " fmt "\n" __VA_OPT__(,) __VA_ARGS__); } while (0)
+#define n_infof(nam, fmt, ...) do { _log_printf("info : " _LOG_STR(nam) ": " fmt "\n" __VA_OPT__(,) __VA_ARGS__); } while (0)
+#define n_debugf(nam, fmt, ...) do { if (_LOG_CAT3(CONFIG_, nam, _DEBUG) && !_LOG_NDEBUG) \
+ _log_printf("debug: " _LOG_STR(nam) ": " fmt "\n" __VA_OPT__(,) __VA_ARGS__); } while (0)
+
+#define errorf(fmt, ...) n_errorf(LOG_NAME, fmt, __VA_ARGS__)
+#define infof(fmt, ...) n_infof(LOG_NAME, fmt, __VA_ARGS__)
+#define debugf(fmt, ...) n_debugf(LOG_NAME, fmt, __VA_ARGS__)
const char *const_byte_str(uint8_t b);