Skip to content

Group logging

Modules > logging

Functions and constants for logging. More...

Public Types

Type Name
typedef void(* tirexLogCallback
Points to a function that takes in a log level, component, and message which should be logged.
typedef enum tirexLogLevel_enum tirexLogLevel
Represents different levels of verbosity.
enum tirexLogLevel_enum
Represents different levels of verbosity.

Public Functions

Type Name
TIREX_TRACKER_EXPORT void tirexSetLogCallback (tirexLogCallback callback)
Set a callback that should be used for all future logs.

Detailed Description

Definitions and functions relevant for telling measure where to log information to.

Public Types Documentation

typedef tirexLogCallback

Points to a function that takes in a log level, component, and message which should be logged.

typedef void(* tirexLogCallback) (tirexLogLevel level, const char *component, const char *message);

The log callback can handle the call as it likes (including ignoring it for example because logging is set to a lower verbosity or turned of). The component may be used to identify, where the log is comming from.


typedef tirexLogLevel

Represents different levels of verbosity.

typedef enum tirexLogLevel_enum tirexLogLevel;

The enum values are sorted by verbosity. That is, for example, if logs should only be logged level INFO or higher, then level >= INFO can be used to check what should be logged.


enum tirexLogLevel_enum

Represents different levels of verbosity.

enum tirexLogLevel_enum {
    TRACE,
    DEBUG,
    INFO,
    WARN,
    ERROR,
    CRITICAL
};

The enum values are sorted by verbosity. That is, for example, if logs should only be logged level INFO or higher, then level >= INFO can be used to check what should be logged.


Public Functions Documentation

function tirexSetLogCallback

Set a callback that should be used for all future logs.

TIREX_TRACKER_EXPORT void tirexSetLogCallback (
    tirexLogCallback callback
) 

Per default, nothing is logged and passing NULL for callback disables logging.

Parameters:

  • callback Points to a function that takes in a log level, component, and message which should be logged. Pass NULL to disable logging.