Folks.Debug – folks Reference Manual

# Debug

## Object Hierarchy:

## Description:

public class Debug : Object

Manages debug output and status reporting for all folks objects.

All GLib debug logging calls are passed through a log handler in this class, which allows debug domains to be outputted according to whether they've been enabled by being passed to Debug.dup.

## Since:

0.5.1

Namespace: Folks
Package: folks

## Content:

### Constants:

- public const string STATUS_LOG_DOMAIN
  Log domain for the status messages logged as a result of calling Debug.emit_print_status.

### Properties:

- public bool colour_enabled { get; set; }
- public bool debug_output_enabled { get; set; }
  Whether debug output is enabled. This is orthogonal to the set of enabled debug domains; filtering of debug output as a whole is done after filtering by enabled domains.

### Static methods:

- public static Debug dup ()
  Create or return the singleton Folks.Debug class instance. If the instance doesn't exist already, it will be created with no debug domains enabled.
- public static Debug dup_with_flags (string? debug_flags, bool colour_enabled)
  Create or return the singleton Folks.Debug class instance. If the instance doesn't exist already, it will be created with the given set of debug domains enabled. Otherwise, the existing instance will have its set of enabled domains changed to the provided set.

### Methods:

- public void emit_print_status ()
  Causes all significant objects in the library to print their current status to standard output, obeying the options set on this Folks.Debug instance for colouring and other formatting.
- public void indent ()
  Increment the indentation level used when printing output through the object.
- public void print_heading (string domain, LogLevelFlags level, string format, ...)
  Print a debug line as a heading. It will be coloured according to the current indentation level so that different levels of headings stand out.
- public void print_key_value_pairs (string domain, LogLevelFlags level, ...)
  Print a set of key–value pairs in a table. The width of the key column is automatically set to the width of the longest key. The keys and values must be provided as a null-delimited list of alternating key–value varargs. Values may be null but keys may not.
- public void print_line (string domain, LogLevelFlags level, string format, ...)
  Print a debug line with the current indentation level for the specified debug domain.
- public void unindent ()
  Decrement the indentation level used when printing output through the object.

### Signals:

- public signal void print_status ()
  Signal emitted in the main thread whenever objects should print their current status. All significant objects in the library should connect to this and print their current status in some suitable format when it's emitted.

### Inherited Members:

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref