summaryrefslogtreecommitdiff
path: root/libmisc
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:52 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-12-09 12:24:52 -0700
commit87646c7959726bc0556d28f78fb730edd8365410 (patch)
tree087f074391f4beccc08626f966d945d0cad60aba /libmisc
parent96a751d8a5d20b2acea5ae8d10ac3d051466c2c3 (diff)
parentb1414723ab4171a7ca5fc5e8a5ac7c4eb43331e2 (diff)
Merge commit 'b1414723ab4171a7ca5fc5e8a5ac7c4eb43331e2'
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);