(trunk gtk) when processing log messages for the Message Log window and we encounter an error messages, pass it to g_warning() as well

This commit is contained in:
Jordan Lee 2012-02-04 23:59:42 +00:00
parent b20110fe67
commit e110757013
1 changed files with 11 additions and 0 deletions

View File

@ -378,6 +378,17 @@ addMessages( GtkListStore * store, struct tr_msg_list * head )
COL_MESSAGE, i->message,
COL_SEQUENCE, ++sequence,
-1 );
/* if it's an error message, dump it to the terminal too */
if( i->level == TR_MSG_ERR )
{
GString * gstr = g_string_sized_new( 512 );
g_string_append_printf( gstr, "%s:%d %s", i->file, i->line, i->message );
if( i->name != NULL )
g_string_append_printf( gstr, " (%s)", i->name );
g_warning( "%s", gstr->str );
g_string_free( gstr, TRUE );
}
}
return i; /* tail */