diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-07-24 06:02:38 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-07-24 06:02:38 +0000 |
| commit | 5be0a82a353b67160142134de1cc51fa31d72759 (patch) | |
| tree | 333f0e70a6cf4f2cb5252c2e16922a1b6408dc06 /openbox/openbox.c | |
| parent | 230abdc5a0848cd05dc3a007826a2a6b8a73c0a5 (diff) | |
use ob_debug for any debug printing and only display the output when its a debug build or when --debug is passed to it
Diffstat (limited to 'openbox/openbox.c')
| -rw-r--r-- | openbox/openbox.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/openbox/openbox.c b/openbox/openbox.c index 4b248a0c..9b79438c 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -1,3 +1,4 @@ +#include "debug.h" #include "openbox.h" #include "dock.h" #include "event.h" @@ -92,6 +93,10 @@ int main(int argc, char **argv) xmlDocPtr doc; xmlNodePtr node; +#ifdef DEBUG + ob_debug_show_output(TRUE); +#endif + state = OB_STATE_STARTING; /* initialize the locale */ @@ -430,7 +435,7 @@ static void sm_startup(int argc, char **argv) g_free(prop_cmd.vals); g_free(prop_res.vals); - g_message("Connected to session manager with id %s", ob_sm_id); + ob_debug("Connected to session manager with id %s\n", ob_sm_id); } g_free (ob_sm_id); #endif @@ -510,6 +515,7 @@ static void print_help() g_print(" --version Display the version and exit\n"); g_print(" --sync Run in synchronous mode (this is slow and\n" " meant for debugging X routines)\n"); + g_print(" --debug Display debugging output\n"); g_print("\nPlease report bugs at %s\n", PACKAGE_BUGREPORT); } @@ -530,6 +536,8 @@ static void parse_args(int argc, char **argv) ob_replace_wm = TRUE; } else if (!strcmp(argv[i], "--sync")) { xsync = TRUE; + } else if (!strcmp(argv[i], "--debug")) { + ob_debug_show_output(TRUE); #ifdef USE_SM } else if (!strcmp(argv[i], "--sm-client-id")) { if (i == argc - 1) /* no args left */ @@ -551,24 +559,24 @@ static void parse_args(int argc, char **argv) static void sm_save_yourself(SmcConn conn, SmPointer data, int save_type, Bool shutdown, int interact_style, Bool fast) { - g_message("got SAVE YOURSELF from session manager"); + ob_debug("got SAVE YOURSELF from session manager\n"); SmcSaveYourselfDone(conn, TRUE); } static void sm_die(SmcConn conn, SmPointer data) { ob_exit(); - g_message("got DIE from session manager"); + ob_debug("got DIE from session manager\n"); } static void sm_save_complete(SmcConn conn, SmPointer data) { - g_message("got SAVE COMPLETE from session manager"); + ob_debug("got SAVE COMPLETE from session manager\n"); } static void sm_shutdown_cancelled(SmcConn conn, SmPointer data) { - g_message("got SHUTDOWN CANCELLED from session manager"); + ob_debug("got SHUTDOWN CANCELLED from session manager\n"); } #endif |
