info: simply some more

This commit is contained in:
Wim Taymans 2009-03-18 18:57:16 +01:00
parent ca33a78881
commit 3857d902c3

View file

@ -784,30 +784,27 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
#undef PRINT_FMT #undef PRINT_FMT
g_free (color); g_free (color);
#else #else
gint pidcolor, levelcolor, color, pid;
const gint clear = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; const gint clear = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
#define SET_COLOR(c) \
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), (c));
/* timestamp */ /* timestamp */
g_printerr ("%" GST_TIME_FORMAT " ", GST_TIME_ARGS (elapsed)); g_printerr ("%" GST_TIME_FORMAT " ", GST_TIME_ARGS (elapsed));
/* pid */ /* pid */
pidcolor = available_colors[pid % 6]; SET_COLOR (available_colors[pid % 6]);
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), pidcolor);
g_printerr (PID_FMT, pid); g_printerr (PID_FMT, pid);
/* thread */ /* thread */
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), clear); SET_COLOR (clear);
g_printerr (" " PTR_FMT " ", g_thread_self ()); g_printerr (" " PTR_FMT " ", g_thread_self ());
/* level */ /* level */
levelcolor = levelcolormap[level]; SET_COLOR (levelcolormap[level]);
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), levelcolor);
g_printerr ("%s ", gst_debug_level_get_name (level)); g_printerr ("%s ", gst_debug_level_get_name (level));
/* category */ /* category */
color = gst_debug_construct_win_color (gst_debug_category_get_color SET_COLOR (gst_debug_construct_win_color (gst_debug_category_get_color
(category)); (category)));
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), color);
g_printerr (CAT_FMT, gst_debug_category_get_name (category), g_printerr (CAT_FMT, gst_debug_category_get_name (category),
file, line, function, obj); file, line, function, obj);
/* message */ /* message */
SetConsoleTextAttribute (GetStdHandle (STD_ERROR_HANDLE), clear); SET_COLOR (clear);
g_printerr (" %s\n", gst_debug_message_get (message)); g_printerr (" %s\n", gst_debug_message_get (message));
#endif #endif
} else { } else {