diff --git a/src/dunst.c b/src/dunst.c index 297784b..18e4536 100644 --- a/src/dunst.c +++ b/src/dunst.c @@ -26,10 +26,6 @@ #define VERSION "version info needed" #endif -#define MSG 1 -#define INFO 2 -#define DEBUG 3 - typedef struct _x11_source { GSource source; Display *dpy; diff --git a/src/menu.c b/src/menu.c index 8f94c96..8849e99 100644 --- a/src/menu.c +++ b/src/menu.c @@ -34,7 +34,7 @@ static int regex_init(void) "(\\([-[:alnum:]_\\@;/?:&=%$.+!*\x27,~#]*\\)|[-[:alnum:]_\\@;/?:&=%$+*~])+"; int ret = regcomp(&cregex, regex, REG_EXTENDED | REG_ICASE); if (ret != 0) { - fputs("failed to compile regex", stderr); + LOG_W("Failed to compile regex."); return 0; } else { is_initialized = true; diff --git a/src/x11/screen.c b/src/x11/screen.c index 1436e51..51bc230 100644 --- a/src/x11/screen.c +++ b/src/x11/screen.c @@ -331,8 +331,7 @@ static int FollowXErrorHandler(Display *display, XErrorEvent *e) dunst_follow_errored = true; char err_buf[BUFSIZ]; XGetErrorText(display, e->error_code, err_buf, BUFSIZ); - fputs(err_buf, stderr); - fputs("\n", stderr); + LOG_W("%s", err_buf); return 0; } diff --git a/src/x11/x.c b/src/x11/x.c index daff023..8233f36 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -832,7 +832,7 @@ gboolean x_mainloop_fd_prepare(GSource *source, gint *timeout) if (timeout) *timeout = -1; else - g_print("BUG: x_mainloop_fd_prepare: timeout == NULL\n"); + LOG_E("x_mainloop_fd_prepare: timeout == NULL"); return false; } @@ -992,7 +992,7 @@ void x_setup(void) /* initialize xctx.dc, font, keyboard, colors */ if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("no locale support\n", stderr); + LOG_W("No locale support"); if (!(xctx.dpy = XOpenDisplay(NULL))) { DIE("Cannot open X11 display."); } @@ -1244,11 +1244,11 @@ static int GrabXErrorHandler(Display *display, XErrorEvent *e) dunst_grab_errored = true; char err_buf[BUFSIZ]; XGetErrorText(display, e->error_code, err_buf, BUFSIZ); - fputs(err_buf, stderr); - fputs("\n", stderr); if (e->error_code != BadAccess) { - exit(EXIT_FAILURE); + DIE("%s", err_buf); + } else { + LOG_W("%s", err_buf); } return 0;