Debug logging and tracing: Builder SDK Reference

## Debug logging and tracing Debug logging and tracing — tracing and debug facilities for Builder and plugins |

## Functions

void | ide_trace_function ()
#define | IDE_TRACE_MSG()
#define | IDE_TODO()
#define | IDE_GOTO()
#define | IDE_RETURN()
#define | IDE_BUG()

## Types and Values

#define | IDE_ENABLE_TRACE
#define | IDE_LOG_LEVEL_TRACE
#define | IDE_PROBE
#define | IDE_ENTRY
#define | IDE_EXIT
#define | IDE_BACKTRACE

## Description

The debug macros such as `IDE_ENTRY`, `IDE_EXIT`, and `IDE_RETURN` provide helpers for tracing Builder and plugins at runtime.

These tracing macros will compile out when Builder is configured for a release build. Otherwise, running Builder with the "-vvvv" command line argument will show tracing output.

## Functions

### ide_trace_function ()

    void
    ide_trace_function (const gchar *strfunc,
                        gint64 begin_time_usec,
                        gint64 end_time_usec);

### IDE_TRACE_MSG()

    #define             IDE_TRACE_MSG(fmt, ...)

Similar to `IDE_PROBE` but allows specifying a log message.

Since: 3.18

### IDE_TODO()

    #define             IDE_TODO(_msg)

Appends to the tracing log that unsupported code has been reached.

#### Parameters

_msg | the message to append to the trace log |

Since: 3.18

### IDE_GOTO()

    #define             IDE_GOTO(_l)

Appends to the jump to label to the tracing log and then jumps to the label `_l` .

#### Parameters

_l | the label to jump to |

Since: 3.18

### IDE_RETURN()

    #define             IDE_RETURN(_r)

Similar to `IDE_EXIT` but allows providing a return value.

Since: 3.18

### IDE_BUG()

    #define             IDE_BUG(Component, Description, ...)

## Types and Values

### IDE_ENABLE_TRACE

    # define IDE_ENABLE_TRACE 0

### IDE_LOG_LEVEL_TRACE

    # define IDE_LOG_LEVEL_TRACE ((GLogLevelFlags)(1 << G_LOG_LEVEL_USER_SHIFT))

### IDE_PROBE

    #define             IDE_PROBE

Appends to the tracing log that a line of code was reached.

Since: 3.18

### IDE_ENTRY

    #define             IDE_ENTRY

Traces the entry into a function. Place this at the beginning of your function above pre-condition checks.

Since: 3.18

### IDE_EXIT

    #define             IDE_EXIT

Traces the exit from a function. Use this instead of "return" to return and log the function exiting.

Since: 3.18

### IDE_BACKTRACE

    #define             IDE_BACKTRACE