From 7f21fd6b283a6b2f43b21b3d7ec7235ddb651ad5 Mon Sep 17 00:00:00 2001 From: "Ian M." Date: Sun, 4 Oct 2026 21:58:44 +0000 Subject: atas: Add debug trace helpers Signed-off-by: Ian M. --- head/atas/trace.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 head/atas/trace.h diff --git a/head/atas/trace.h b/head/atas/trace.h new file mode 100644 index 0000000..a799aa5 --- /dev/null +++ b/head/atas/trace.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2026, Apollo Telephone Laboratories. + * Provided under the BSD-3 clause. + */ + +#ifndef ATAS_TRACE_H +#define ATAS_TRACE_H 1 + +#include + +#if defined(ATAS_DEBUG) +#define trace_debug(fmt, ...) \ + printf("[debug]: " fmt, ##__VA_ARGS__) +#else +#define trace_debug(...) \ + ((void)0) +#endif + +#define trace_warn(fmt, ...) \ + printf("[warning]: " fmt, ##__VA_ARGS__) +#define trace_fatal(fmt, ...) \ + printf("[fatal]: " fmt, ##__VA_ARGS__) + +#endif /* !ATAS_TRACE_H */ -- cgit v1.2.3