#define trace(level, ...) tracef(__FILE__, __func__, __LINE__, level, __VA_ARGS__) #define debug(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_DEBUG, __VA_ARGS__) #define info(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_INFO, __VA_ARGS__) #define warning(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_WARNING, __VA_ARGS__) #define error(...) tracef(__FILE__, __func__, __LINE__, TraceLevel_ERROR, __VA_ARGS__) enum TraceLevel { TraceLevel_NONE = 1, TraceLevel_ERROR = 2, TraceLevel_WARNING = 3, TraceLevel_INFO = 4, TraceLevel_DEBUG = 5, }; void vftracef( const char *const file, const char *const function, const int lineno, FILE *restrict stream, const enum TraceLevel level, const char *restrict format, va_list args ); void ftracef( const char *const file, const char *const function, const int lineno, FILE *restrict stream, const enum TraceLevel level, const char *restrict format, ... ); void tracef( const char *const file, const char *const function, const int lineno, const enum TraceLevel level, const char *restrict format, ... ); int trace_set_stream(FILE *stream); int trace_set_level(const enum TraceLevel level);