mirror of
https://github.com/brl/mutter.git
synced 2025-07-27 03:58:32 +00:00
Strip whitespace in warnings and errors
The old log system did not add a newline at the end, but the new one does, so don't add another one.
This commit is contained in:
@@ -437,38 +437,53 @@ meta_debug_init (void)
|
|||||||
void
|
void
|
||||||
meta_bug (const char *format, ...)
|
meta_bug (const char *format, ...)
|
||||||
{
|
{
|
||||||
|
char *stripped;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail (format != NULL);
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
|
stripped = g_strstrip (g_strdup (format));
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, stripped, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
|
g_free (stripped);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_warning (const char *format, ...)
|
meta_warning (const char *format, ...)
|
||||||
{
|
{
|
||||||
|
char *stripped;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail (format != NULL);
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
|
stripped = g_strstrip (g_strdup (format));
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, args);
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, stripped, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
|
g_free (stripped);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_fatal (const char *format, ...)
|
meta_fatal (const char *format, ...)
|
||||||
{
|
{
|
||||||
|
char *stripped;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail (format != NULL);
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
|
stripped = g_strstrip (g_strdup (format));
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, format, args);
|
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, stripped, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
|
g_free (stripped);
|
||||||
|
|
||||||
meta_exit (META_EXIT_ERROR);
|
meta_exit (META_EXIT_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user