mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 07:30:54 +00:00
libsysprof-capture: add sysprof_collector_log_printf()
This is a convenience function to call sysprof_collector_log() while also formatting the message. Ideally we'd be able to avoid the string format if we are not currently collecting data, but that can be left for a future commit. We don't have recursive locks so we need to duplicate the structure setup.
This commit is contained in:
@ -454,3 +454,19 @@ sysprof_collector_log (GLogLevelFlags severity,
|
||||
|
||||
} COLLECTOR_END;
|
||||
}
|
||||
|
||||
void
|
||||
sysprof_collector_log_printf (GLogLevelFlags severity,
|
||||
const gchar *domain,
|
||||
const gchar *format,
|
||||
...)
|
||||
{
|
||||
g_autofree gchar *formatted = NULL;
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
formatted = g_strdup_vprintf (format, args);
|
||||
va_end (args);
|
||||
|
||||
sysprof_collector_log (severity, domain, formatted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user