Function

GLib-2.0GLiblog_get_always_fatalSince 2.86

  • Gets the current fatal mask.

    This is mostly used by custom log writers to make fatal messages (fatal-warnings, fatal-criticals) work as expected, when using the G_DEBUG environment variable (see Running GLib Applications).

    An example usage is shown below:

    static GLogWriterOutput
    my_custom_log_writer_fn (GLogLevelFlags log_level,
    const GLogField *fields,
    gsize n_fields,
    gpointer user_data)
    {

    // abort if the message was fatal
    if (log_level & g_log_get_always_fatal ())
    g_abort ();

    // custom log handling code
    ...
    ...

    // success
    return G_LOG_WRITER_HANDLED;
    }

    Returns LogLevelFlags

    the current fatal mask

    2.86