aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dc/dc.c2
-rw-r--r--teensy/teensy_log.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/dc/dc.c b/dc/dc.c
index acb1e74..942174b 100644
--- a/dc/dc.c
+++ b/dc/dc.c
@@ -78,7 +78,7 @@ int main(void)
ty_sleep(1000 / hints.ticrate);
- ty_log_info("%g ms", (float)(clock() - start) / CLOCKS_PER_SEC);
+ ty_log_debug("%g ms", (float)(clock() - start) / CLOCKS_PER_SEC);
}
ty_free_image(img);
diff --git a/teensy/teensy_log.h b/teensy/teensy_log.h
index 825ce55..9c54d62 100644
--- a/teensy/teensy_log.h
+++ b/teensy/teensy_log.h
@@ -15,6 +15,14 @@
#define ty_log_fatal(ec, fmt, ...) \
(ty_log_msg(stderr, __FILE__, __LINE__, "fatal", fmt, ## __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__)
+#else
+#define ty_log_debug(fmt, ...)
+#endif // TEENSY_DEBUG
+
#define ty_olog(fmt, ...) \
_log_plain(stdout, fmt, ## __VA_ARGS__)
#define ty_elog(fmt, ...) \