## gedit-debug

gedit-debug

## Functions

void | gedit_debug_init ()
void | gedit_debug ()
void | gedit_debug_message ()
void | gedit_debug_plugin_message ()

## Types and Values

enum | GeditDebugSection
#define | DEBUG_PREFS
#define | DEBUG_WINDOW
#define | DEBUG_PANEL
#define | DEBUG_PLUGINS
#define | DEBUG_TAB
#define | DEBUG_DOCUMENT
#define | DEBUG_COMMANDS
#define | DEBUG_APP
#define | DEBUG_UTILS

## Object Hierarchy

        GFlags
        ╰── GeditDebugSection

## Description

## Functions

### 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 `section` is enabled, then logs the trace information `file` , `line` , and `function` .

#### Parameters

section | debug section. |
file | file name. |
line | line number. |
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 `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.

#### Parameters

section | debug section. |
file | file name. |
line | line number. |
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 the section `GEDIT_DEBUG_PLUGINS` is enabled, then logs the trace information `file` , `line` , and `function` along with `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.

#### Parameters

file | file name. |
line | line number. |
function | name of the function that is calling `gedit_debug_plugin_message()`. |
message | a message. |

Since: 3.4

## Types and Values

### enum 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.

#### Members

GEDIT_NO_DEBUG |  |
GEDIT_DEBUG_PREFS |  |
GEDIT_DEBUG_WINDOW |  |
GEDIT_DEBUG_PANEL |  |
GEDIT_DEBUG_PLUGINS |  |
GEDIT_DEBUG_TAB |  |
GEDIT_DEBUG_DOCUMENT |  |
GEDIT_DEBUG_COMMANDS |  |
GEDIT_DEBUG_APP |  |
GEDIT_DEBUG_UTILS |  |

### DEBUG_PREFS

    #define DEBUG_PREFS GEDIT_DEBUG_PREFS,   __FILE__, __LINE__, G_STRFUNC

### DEBUG_WINDOW

    #define DEBUG_WINDOW GEDIT_DEBUG_WINDOW,  __FILE__, __LINE__, G_STRFUNC

### DEBUG_PANEL

    #define DEBUG_PANEL GEDIT_DEBUG_PANEL,   __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_UTILS

    #define DEBUG_UTILS GEDIT_DEBUG_UTILS,   __FILE__, __LINE__, G_STRFUNC