## Debugging Debugging — Debugging macros |

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | GCAL_TRACE_MSG()
#define | GCAL_TODO()
#define | GCAL_GOTO()
#define | GCAL_RETURN()
#define | GCAL_BUG()

## Types and Values

#define | GCAL_ENABLE_TRACE
#define | GCAL_LOG_LEVEL_TRACE
#define | GCAL_PROBE
#define | GCAL_ENTRY
#define | GCAL_EXIT

## Description

Macros used for tracing and debugging code. These are only valid when Calendar is compiled with tracing suppoer (pass `--enable-tracing` to the configure script to do that).

## Functions

### GCAL_TRACE_MSG()

    #define             GCAL_TRACE_MSG(fmt, ...)

Prints a trace message.

#### Parameters

fmt | printf-like format of the message |
... | arguments for `fmt` |

### GCAL_TODO()

    #define             GCAL_TODO(_msg)

Prints a TODO message.

#### Parameters

_msg | the message to print |

### GCAL_GOTO()

    #define             GCAL_GOTO(_l)

Logs a goto jump.

#### Parameters

_l | goto tag |

### GCAL_RETURN()

    #define             GCAL_RETURN(_r)

Prints an exit message, and returns `_r` . See GCAL_EXIT.

#### Parameters

_r | the return value. |

### GCAL_BUG()

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

Logs a bug-friendly message.

#### Parameters

Component | the component |
Description | the description |
... | extra arguments |

## Types and Values

### GCAL_ENABLE_TRACE

    # define GCAL_ENABLE_TRACE 0

### GCAL_LOG_LEVEL_TRACE

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

### GCAL_PROBE

    #define             GCAL_PROBE

Prints a probing message.

### GCAL_ENTRY

    #define             GCAL_ENTRY

Prints a probing message. This shouldn't be used in critical functions. Place this at the beggining of the function, before any assertion.

### GCAL_EXIT

    #define             GCAL_EXIT

Prints an exit message. This shouldn't be used in critical functions. Place this at the end of the function, after any relevant code. If the function returns somethin, use `GCAL_RETURN()` instead.