aboutsummaryrefslogtreecommitdiff
path: root/teensy/teensy_log.h
diff options
context:
space:
mode:
Diffstat (limited to 'teensy/teensy_log.h')
-rw-r--r--teensy/teensy_log.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/teensy/teensy_log.h b/teensy/teensy_log.h
index 9c54d62..d1dc198 100644
--- a/teensy/teensy_log.h
+++ b/teensy/teensy_log.h
@@ -6,28 +6,23 @@
// Don't include common.h, because this should be included there
-#define ty_log_info(fmt, ...) \
- ty_log_msg(stdout, __FILE__, __LINE__, "info", fmt, ## __VA_ARGS__)
-#define ty_log_warn(fmt, ...) \
- ty_log_msg(stderr, __FILE__, __LINE__, "warn", fmt, ## __VA_ARGS__)
-#define ty_log_err(fmt, ...) \
- ty_log_msg(stderr, __FILE__, __LINE__, "error", fmt, ## __VA_ARGS__)
-#define ty_log_fatal(ec, fmt, ...) \
- (ty_log_msg(stderr, __FILE__, __LINE__, "fatal", fmt, ## __VA_ARGS__), \
+#define ty_log_info(...) \
+ ty_log_msg(stdout, __FILE__, __LINE__, "info", __VA_ARGS__)
+#define ty_log_warn(...) \
+ ty_log_msg(stderr, __FILE__, __LINE__, "warn", __VA_ARGS__)
+#define ty_log_err(...) \
+ ty_log_msg(stderr, __FILE__, __LINE__, "error", __VA_ARGS__)
+#define ty_log_fatal(ec, ...) \
+ (ty_log_msg(stderr, __FILE__, __LINE__, "fatal", __VA_ARGS__), \
exit(ec))
#if defined(TEENSY_DEBUG) || !defined(NDEBUG)
-#define ty_log_debug(fmt, ...) \
- ty_log_msg(stderr, __FILE__, __LINE__, "debug", fmt, ## __VA_ARGS__)
+#define ty_log_debug(...) \
+ ty_log_msg(stderr, __FILE__, __LINE__, "debug", __VA_ARGS__)
#else
-#define ty_log_debug(fmt, ...)
+#define ty_log_debug(...)
#endif // TEENSY_DEBUG
-#define ty_olog(fmt, ...) \
- _log_plain(stdout, fmt, ## __VA_ARGS__)
-#define ty_elog(fmt, ...) \
- _log_plain(stderr, fmt, ## __VA_ARGS__)
-
// To be passed as the exit code to log_fatal()
// General errors