xtd_c - Reference Guide 0.2.0
trace_listener

Definition

Provides the abstract base class for the listeners who monitor trace and debug output.

Remarks
For examples of how to implement a trace_listener, see the default_trace_listener, text_writer_trace_listener and the event_log_trace_listener classes.
You must enable tracing or debugging to use a trace listener. The syntax is compiler specific. If you use other than cmake to manage your build, refer to the documentation of your build manager. To enable debugging with cmake, add the add_definitions(-DDEBUG) command line in the CMakeLists.txt of your project, or you can add #define DEBUG to the top of your file but in this case, the compiler options for debug is not activated. To enable tracing with cmake, add the add_definitions(-DTRACE) command line in the CMakeLists.txt of your project, or you can add #define TRACE to the top of your file.
Note
to Inheritors: Inherit from this class to implement a custom listener for the debug and trace classes. At a minimum, you must implement the write and write_line methods. Additionally, you can implement the fail, close and flush methods.

Data Structures

struct  xtd_diagnostics_trace_listener
 Defines the trace_listener object. More...
 

Converter

#define XTD_DIAGNOSTICS_TRACE_LISTENER(object)   (XTD_TYPE_CAST(object, XTD_DIAGNOSTICS_TRACE_LISTENER_TYPE, xtd_diagnostics_trace_listener))
 Convert an xtd object to trace_listener object. More...
 

Macro Definition Documentation

◆ XTD_DIAGNOSTICS_TRACE_LISTENER

#define XTD_DIAGNOSTICS_TRACE_LISTENER (   object)    (XTD_TYPE_CAST(object, XTD_DIAGNOSTICS_TRACE_LISTENER_TYPE, xtd_diagnostics_trace_listener))

Convert an xtd object to trace_listener object.

Library
xtd_c.core