Commit 0aa29b31 authored by Antoine Cellerier's avatar Antoine Cellerier

fix debug output colors

parent 733f0a84
...@@ -448,6 +448,9 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item ) ...@@ -448,6 +448,9 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
# define RED COL(31) # define RED COL(31)
# define GREEN COL(32) # define GREEN COL(32)
# define YELLOW COL(33) # define YELLOW COL(33)
# define BLUE COL(34)
# define MAGENTA COL(35)
# define CYAN COL(36)
# define WHITE COL(37) # define WHITE COL(37)
# define GRAY "\033[0m" # define GRAY "\033[0m"
...@@ -455,7 +458,9 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item ) ...@@ -455,7 +458,9 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
int i_dummy; int i_dummy;
#endif #endif
static const char * ppsz_type[4] = { "", " error", " warning", " debug" }; static const char * ppsz_type[4] = { "", " error", " warning", " debug" };
static const char *ppsz_color[4] = { WHITE, RED, YELLOW, GRAY }; static const char *ppsz_color[4] = { WHITE, RED, YELLOW, CYAN };
static const char *ppsz_colors[7] = {RED, GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE};
int i_int = 0;
char *psz_object = "private"; char *psz_object = "private";
int i_type = p_item->i_type; int i_type = p_item->i_type;
...@@ -514,10 +519,17 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item ) ...@@ -514,10 +519,17 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
/* Send the message to stderr */ /* Send the message to stderr */
if( p_this->p_libvlc->b_color ) if( p_this->p_libvlc->b_color )
{ {
fprintf( stderr, "[" GREEN "%.8i" GRAY "] %s %s%s: %s%s" GRAY "\n", /*fprintf( stderr, "[" GREEN "%.8i" GRAY "] %s %s%s" GRAY ": %s%s" GRAY "\n",
p_item->i_object_id, p_item->psz_module, psz_object, p_item->i_object_id, p_item->psz_module, psz_object,
ppsz_type[i_type], ppsz_color[i_type], ppsz_type[i_type], ppsz_color[i_type],
p_item->psz_msg ); p_item->psz_msg );*/
fprintf( stderr, "[" GREEN "%.8i" GRAY "] %s %s%s" GRAY ": ", p_item->i_object_id, p_item->psz_module, psz_object,
ppsz_type[i_type]);
for( i_int=0; p_item->psz_msg[i_int]!=0; i_int++ )
{
fprintf( stderr, "%s%c", ppsz_colors[i_int%7], p_item->psz_msg[i_int] );
}
fprintf( stderr, GRAY "\n");
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment