mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
improve g_log_set_handler docs
2001-12-06 Havoc Pennington <hp@redhat.com> * glib/tmpl/messages.sgml: improve g_log_set_handler docs
This commit is contained in:
parent
39e4c5afe8
commit
e3516e3ad8
@ -1,3 +1,7 @@
|
|||||||
|
2001-12-06 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
|
* glib/tmpl/messages.sgml: improve g_log_set_handler docs
|
||||||
|
|
||||||
Wed Nov 28 18:50:19 2001 Owen Taylor <otaylor@redhat.com>
|
Wed Nov 28 18:50:19 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/glib-sections.txt: Update.
|
* glib/glib-sections.txt: Update.
|
||||||
|
@ -166,15 +166,32 @@ must be combined with the G_LOG_FLAG_FATAL and G_LOG_FLAG_RECURSIVE bit flags.
|
|||||||
Note that since the G_LOG_LEVEL_ERROR log level is always fatal, if you want
|
Note that since the G_LOG_LEVEL_ERROR log level is always fatal, if you want
|
||||||
to set a handler for this log level you must combine it with G_LOG_FLAG_FATAL.
|
to set a handler for this log level you must combine it with G_LOG_FLAG_FATAL.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>Adding a log handler for all warning messages</title>
|
<title>Adding a log handler for all warning messages in the default (application) domain</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
g_log_set_handler (NULL, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
|
g_log_set_handler (NULL, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
|
||||||
| G_LOG_FLAG_RECURSIVE, my_log_handler, NULL);
|
| G_LOG_FLAG_RECURSIVE, my_log_handler, NULL);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
|
<example>
|
||||||
|
<title>Adding a log handler for all critical messages from GTK+</title>
|
||||||
|
<programlisting>
|
||||||
|
g_log_set_handler ("Gtk", G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL
|
||||||
|
| G_LOG_FLAG_RECURSIVE, my_log_handler, NULL);
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
|
||||||
|
<example>
|
||||||
|
<title>Adding a log handler for <emphasis>all</emphasis> messages from GLib</title>
|
||||||
|
<programlisting>
|
||||||
|
g_log_set_handler ("GLib", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
|
||||||
|
| G_LOG_FLAG_RECURSIVE, my_log_handler, NULL);
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
|
||||||
@log_domain: the log domain, or %NULL for the default "" application domain.
|
@log_domain: the log domain, or %NULL for the default "" application domain.
|
||||||
@log_levels: the log levels to apply the log handler for. To handle fatal
|
@log_levels: the log levels to apply the log handler for. To handle fatal
|
||||||
and recursive messages as well, combine the log levels with the
|
and recursive messages as well, combine the log levels with the
|
||||||
|
Loading…
Reference in New Issue
Block a user