TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
Loading...
Searching...
No Matches
Tracer Macros

Macros for enabling and controlling tracing functionality. More...

Macros

#define TEC_ENTER(name)
 Logs an entry message for a named context (e.g., function).
 
#define TEC_TRACE(...)
 Logs a formatted trace message.
 

Detailed Description

Macros for enabling and controlling tracing functionality.

These macros provide a convenient interface for tracing when _TEC_TRACE_ON is defined. They are disabled otherwise to avoid performance overhead.

Example
void func_name(int param) {
TEC_ENTER("func_name");
TEC_TRACE("called with `param`={}", param);
tec::Status status = call_some_func(param);
TEC_TRACE("call_some_func({}) returned {}.", param, status);
}
#define TEC_ENTER(name)
Logs an entry message for a named context (e.g., function).
Definition tec_trace.hpp:211
#define TEC_TRACE(...)
Logs a formatted trace message.
Definition tec_trace.hpp:222

Macro Definition Documentation

◆ TEC_ENTER

#define TEC_ENTER (   name)

Logs an entry message for a named context (e.g., function).

Creates a Tracer object and calls its enter() method to log a timestamped entry message.

Parameters
nameThe name of the context to trace (e.g., function name).
Note
Does nothing when _TEC_TRACE_ON is not defined.

◆ TEC_TRACE

#define TEC_TRACE (   ...)

Logs a formatted trace message.

Calls the trace() method on a Tracer object to log a timestamped message with the provided format string and arguments.

Parameters
format_stringThe format string containing "{}" placeholders.
argsThe arguments to include in the trace message.
Note
Does nothing when _TEC_TRACE_ON is not defined.