common: Add trace.h header

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-03-21 15:22:40 -04:00
parent 7bed587da5
commit 38a00fa509

21
include/common/trace.h Normal file
View File

@@ -0,0 +1,21 @@
/*
* Copyright (c) 2026, Mirocom Laboratories
* Provided under the BSD-3 clause
*
* Abstract:
* This header provides trace helpers.
* Author:
* Ian M. Moffett <ian@mirocom.org>
*/
#ifndef COMMON_TRACE_H
#define COMMON_TRACE_H 1
#include <stdio.h>
#include "common/state.h"
#define trace_error(state, fmt, ...) \
printf("fatal: " fmt, ##__VA_ARGS__); \
printf("near line %d\n", (state)->line_num);
#endif /* !COMMON_TRACE_H */