common: Add trace.h header
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
21
include/common/trace.h
Normal file
21
include/common/trace.h
Normal 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 */
|
||||
Reference in New Issue
Block a user