cleanup logging in the GUI

This commit is contained in:
Cedric Roux
2016-05-02 09:47:30 +02:00
parent c3e59b16b3
commit e4e4647345
10 changed files with 56 additions and 55 deletions
+4 -8
View File
@@ -13,7 +13,7 @@ unsigned long register_notifier(gui *_g, char *notification, widget *w,
glock(g);
if (g->next_notifier_id == 2UL * 1024 * 1024 * 1024)
{ printf("%s:%d: report a bug\n", __FILE__, __LINE__); abort(); }
ERR("%s:%d: report a bug\n", __FILE__, __LINE__);
g->notifiers = realloc(g->notifiers,
(g->notifiers_count+1) * sizeof(struct notifier));
@@ -50,11 +50,8 @@ void unregister_notifier(gui *_g, unsigned long notifier_id)
for (i = 0; i < g->notifiers_count; i++)
if (g->notifiers[i].id == notifier_id) break;
if (i == g->notifiers_count) {
printf("%s:%d: notifier_id %ld not found\n", __FILE__, __LINE__,
notifier_id);
abort();
}
if (i == g->notifiers_count)
ERR("%s:%d: notifier_id %ld not found\n", __FILE__,__LINE__,notifier_id);
free(g->notifiers[i].notification);
@@ -83,8 +80,7 @@ void gui_notify(struct gui *g, char *notification, widget *w,
* for now let's crash in case of recursive call
*/
static int inside = 0;
if (inside)
{printf("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__);abort();}
if (inside) ERR("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__);
inside = 1;
/* clear all handlers */