X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fdebug.c;h=8423e8ab565bb079d9a0f00cdc44cf5dc81f67ad;hb=3ff416203439afb00b66b04f473669eab1f425e4;hp=04a958208ecf1ac9d4cc315d33e38e19ad98cfa7;hpb=722a712b8c8884cab44bedcb53fa3e13f4c29edc;p=chaz%2Fopenbox diff --git a/openbox/debug.c b/openbox/debug.c index 04a95820..8423e8ab 100644 --- a/openbox/debug.c +++ b/openbox/debug.c @@ -102,11 +102,11 @@ void ob_debug_enable(ObDebugType type, gboolean enable) static inline void log_print(FILE *out, const gchar* log_domain, const gchar *level, const gchar *message) { - fprintf(out, log_domain); + fprintf(out, "%s", log_domain); fprintf(out, "-"); - fprintf(out, level); + fprintf(out, "%s", level); fprintf(out, ": "); - fprintf(out, message); + fprintf(out, "%s", message); fprintf(out, "\n"); fflush(out); } @@ -135,7 +135,9 @@ static void prompt_handler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer data) { if (ob_state() == OB_STATE_RUNNING) - prompt_show_message(message, _("Close")); + prompt_show_message(message, _("Openbox"), _("Close")); + else + log_handler(log_domain, log_level, message, data); } static inline void log_argv(ObDebugType type, @@ -161,7 +163,7 @@ static inline void log_argv(ObDebugType type, g_free(a); } - g_debug(message); + g_debug("%s", message); g_free(message); }