## Debugging Debugging — Debug functions |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/anjuta-debug.h>

    #define             DEBUG_PRINT                         (format,
                                                             ...)
    void                anjuta_debug_init                   (void);

## Description

Anjuta debug messages displayed with `g_debug()` can be filtered based on their domain. By default if DEBUG is defiled, all message are displayed. If DEBUG is not defined, all messages are hidden.

This behavior can be changed using the ANJUTA_LOG_DOMAINS environment variable. If this variable is set to "all", all message are displayed whatever is the value of DEBUG. Else you can set it to a list of domains separated by space to display messages from these selected domains only. If G_LOG_DOMAIN is undefined, it will match a domain named "NULL".

By example

    ANJUTA_LOG_DOMAINS=Gtk Anjuta libanjuta-gdb

will display debug messages from Gtk, Anjuta and gdb plugin only.

## Details

### DEBUG_PRINT()

    		#define DEBUG_PRINT(format, ...) g_debug ("%s:%d (%s) " format, __FILE__, __LINE__, G_STRFUNC, ##__VA_ARGS__)

Equivalent to `g_debug()` showing the FILE, the LINE and the FUNC, except it has only effect when DEBUG is defined. Used for printing debug messages.

### anjuta_debug_init ()

    void                anjuta_debug_init                   (void);

Initialize filtering of debug messages.