Function

GLiblog_get_always_fatal

unstable since: 2.86

Declaration [src]

GLogLevelFlags
g_log_get_always_fatal (
  void
)

Description [src]

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;
}

Available since: 2.86

Return value

Type: GLogLevelFlags

The current fatal mask.