## gedit-debug

gedit-debug

## Synopsis

    enum                GeditDebugSection;
    #define             DEBUG_VIEW
    #define             DEBUG_SEARCH
    #define             DEBUG_PRINT
    #define             DEBUG_PREFS
    #define             DEBUG_PLUGINS
    #define             DEBUG_TAB
    #define             DEBUG_DOCUMENT
    #define             DEBUG_COMMANDS
    #define             DEBUG_APP
    #define             DEBUG_SESSION
    #define             DEBUG_UTILS
    #define             DEBUG_METADATA
    #define             DEBUG_WINDOW
    #define             DEBUG_LOADER
    #define             DEBUG_SAVER
    #define             DEBUG_PANEL
    #define             DEBUG_DBUS
    void                gedit_debug_init                    (void);
    void                gedit_debug                         (GeditDebugSection section,
                                                             const gchar *file,
                                                             gint line,
                                                             const gchar *function);
    void                gedit_debug_message                 (GeditDebugSection section,
                                                             const gchar *file,
                                                             gint line,
                                                             const gchar *function,
                                                             const gchar *format,
                                                             ...);
    void                gedit_debug_plugin_message          (const gchar *file,
                                                             gint line,
                                                             const gchar *function,
                                                             const gchar *message);

## Description

## Details

### enum GeditDebugSection

    typedef enum {
    	GEDIT_NO_DEBUG       = 0,
    	GEDIT_DEBUG_VIEW     = 1 << 0,
    	GEDIT_DEBUG_SEARCH   = 1 << 1,
    	GEDIT_DEBUG_PRINT    = 1 << 2,
    	GEDIT_DEBUG_PREFS    = 1 << 3,
    	GEDIT_DEBUG_PLUGINS  = 1 << 4,
    	GEDIT_DEBUG_TAB      = 1 << 5,
    	GEDIT_DEBUG_DOCUMENT = 1 << 6,
    	GEDIT_DEBUG_COMMANDS = 1 << 7,
    	GEDIT_DEBUG_APP      = 1 << 8,
    	GEDIT_DEBUG_SESSION  = 1 << 9,
    	GEDIT_DEBUG_UTILS    = 1 << 10,
    	GEDIT_DEBUG_METADATA = 1 << 11,
    	GEDIT_DEBUG_WINDOW   = 1 << 12,
    	GEDIT_DEBUG_LOADER   = 1 << 13,
    	GEDIT_DEBUG_SAVER    = 1 << 14,
    	GEDIT_DEBUG_PANEL    = 1 << 15,
    	GEDIT_DEBUG_DBUS     = 1 << 16
    } GeditDebugSection;

Enumeration of debug sections.

Debugging output for a section is enabled by setting an environment variable of the same name. For example, setting the `GEDIT_DEBUG_PLUGINS` environment variable enables all debugging output for the `GEDIT_DEBUG_PLUGINS` section. Setting the special environment variable `GEDIT_DEBUG` enables output for all sections.

`GEDIT_NO_DEBUG` |
`GEDIT_DEBUG_VIEW` |
`GEDIT_DEBUG_SEARCH` |
`GEDIT_DEBUG_PRINT` |
`GEDIT_DEBUG_PREFS` |
`GEDIT_DEBUG_PLUGINS` |
`GEDIT_DEBUG_TAB` |
`GEDIT_DEBUG_DOCUMENT` |
`GEDIT_DEBUG_COMMANDS` |
`GEDIT_DEBUG_APP` |
`GEDIT_DEBUG_SESSION` |
`GEDIT_DEBUG_UTILS` |
`GEDIT_DEBUG_METADATA` |
`GEDIT_DEBUG_WINDOW` |
`GEDIT_DEBUG_LOADER` |
`GEDIT_DEBUG_SAVER` |
`GEDIT_DEBUG_PANEL` |
`GEDIT_DEBUG_DBUS` |

### DEBUG_VIEW

    #define DEBUG_VIEW GEDIT_DEBUG_VIEW,    __FILE__, __LINE__, G_STRFUNC

### DEBUG_SEARCH

    #define DEBUG_SEARCH GEDIT_DEBUG_SEARCH,  __FILE__, __LINE__, G_STRFUNC

### DEBUG_PRINT

    #define DEBUG_PRINT GEDIT_DEBUG_PRINT,   __FILE__, __LINE__, G_STRFUNC

### DEBUG_PREFS

    #define DEBUG_PREFS GEDIT_DEBUG_PREFS,   __FILE__, __LINE__, G_STRFUNC

### DEBUG_PLUGINS

    #define DEBUG_PLUGINS GEDIT_DEBUG_PLUGINS, __FILE__, __LINE__, G_STRFUNC

### DEBUG_TAB

    #define DEBUG_TAB GEDIT_DEBUG_TAB,     __FILE__, __LINE__, G_STRFUNC

### DEBUG_DOCUMENT

    #define DEBUG_DOCUMENT GEDIT_DEBUG_DOCUMENT,__FILE__, __LINE__, G_STRFUNC

### DEBUG_COMMANDS

    #define DEBUG_COMMANDS GEDIT_DEBUG_COMMANDS,__FILE__, __LINE__, G_STRFUNC

### DEBUG_APP

    #define DEBUG_APP GEDIT_DEBUG_APP,     __FILE__, __LINE__, G_STRFUNC

### DEBUG_SESSION

    #define DEBUG_SESSION GEDIT_DEBUG_SESSION, __FILE__, __LINE__, G_STRFUNC

### DEBUG_UTILS

    #define DEBUG_UTILS GEDIT_DEBUG_UTILS,   __FILE__, __LINE__, G_STRFUNC

### DEBUG_METADATA

    #define DEBUG_METADATA GEDIT_DEBUG_METADATA,__FILE__, __LINE__, G_STRFUNC

### DEBUG_WINDOW

    #define DEBUG_WINDOW GEDIT_DEBUG_WINDOW,  __FILE__, __LINE__, G_STRFUNC

### DEBUG_LOADER

    #define DEBUG_LOADER GEDIT_DEBUG_LOADER,  __FILE__, __LINE__, G_STRFUNC

### DEBUG_SAVER

    #define DEBUG_SAVER GEDIT_DEBUG_SAVER,   __FILE__, __LINE__, G_STRFUNC

### DEBUG_PANEL

    #define DEBUG_PANEL GEDIT_DEBUG_PANEL,   __FILE__, __LINE__, G_STRFUNC

### DEBUG_DBUS

    #define DEBUG_DBUS GEDIT_DEBUG_DBUS,    __FILE__, __LINE__, G_STRFUNC

### gedit_debug_init ()

    void                gedit_debug_init                    (void);

Initializes the debugging subsystem of Gedit.

The function checks for the existence of certain environment variables to determine whether to enable output for a debug section. To enable output for a specific debug section, set an environment variable of the same name; e.g. to enable output for the `GEDIT_DEBUG_PLUGINS` section, set a `GEDIT_DEBUG_PLUGINS` environment variable. To enable output for all debug sections, set the `GEDIT_DEBUG` environment variable.

This function must be called before any of the other debug functions are called. It must only be called once.

### gedit_debug ()

    void                gedit_debug                         (GeditDebugSection section,
                                                             const gchar *file,
                                                             gint line,
                                                             const gchar *function);

If output for debug section `section` is enabled, then logs the trace information `file`, `line`, and `function`.

`section` : | Debug section.
`file` : | Name of the source file containing the call to `gedit_debug()`.
`line` : | Line number within the file named by `file` of the call to `gedit_debug()`.
`function` : | Name of the function that is calling `gedit_debug()`.

### gedit_debug_message ()

    void                gedit_debug_message                 (GeditDebugSection section,
                                                             const gchar *file,
                                                             gint line,
                                                             const gchar *function,
                                                             const gchar *format,
                                                             ...);

If output for debug section `section` is enabled, then logs the trace information `file`, `line`, and `function` along with the message obtained by formatting `format` with the given format string arguments.

`section` : | Debug section.
`file` : | Name of the source file containing the call to `gedit_debug_message()`.
`line` : | Line number within the file named by `file` of the call to `gedit_debug_message()`.
`function` : | Name of the function that is calling `gedit_debug_message()`.
`format` : | A `g_vprintf()` format string.
`...` : | The format string arguments.

### gedit_debug_plugin_message ()

    void                gedit_debug_plugin_message          (const gchar *file,
                                                             gint line,
                                                             const gchar *function,
                                                             const gchar *message);

If output for debug section `GEDIT_DEBUG_PLUGINS` is enabled, then logs the trace information `file`, `line`, and `function` along with the informational message `message`.

This function may be overridden by GObject Introspection language bindings to be more language-specific.

Python

A PyGObject override is provided that has the following signature:

    1
    2

    def debug_plugin_message(format_str, *format_args):
        #...

It automatically supplies parameters `file`, `line`, and `function`, and it formats `format_str` with the given format arguments. The syntax of the format string is the usual Python string formatting syntax described by 5.6.2. String Formatting Operations.

`file` : | Name of the source file containing the call to `gedit_debug_plugin_message()`.
`line` : | Line number within the file named by `file` of the call to `gedit_debug_plugin_message()`.
`function` : | Name of the function that is calling `gedit_debug_plugin_message()`.
`message` : | An informational message.

Since 3.4