diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2018-07-29 17:02:29 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2018-07-29 17:02:29 +0900 |
commit | f2db8c530169cbed8de0b531aa7f26ee5e64b510 (patch) | |
tree | 150f4bd25ef0639f4d1109c1f0bcfb57510cb505 | |
parent | beb003210ddae6bf7a86bc02312fa87a61aba893 (diff) | |
download | ibus-hangul-f2db8c530169cbed8de0b531aa7f26ee5e64b510.tar.gz |
Print debug messages when verbose option is on
With --verbose command line option, ibus-hangul will
set G_MESSAGES_DEBUG environment varible as all, if
G_MESSAGES_DEBUG is not set.
This is for convenience.
-rw-r--r-- | src/engine.c | 2 | ||||
-rw-r--r-- | src/main.c | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/engine.c b/src/engine.c index 369e6f1..a72a38f 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1290,6 +1290,7 @@ ibus_hangul_engine_flush (IBusHangulEngine *hangul) str = ustring_begin (hangul->preedit); text = ibus_text_new_from_ucs4 (str); + g_debug("flush: %s", text->text); ibus_engine_commit_text ((IBusEngine *) hangul, text); ustring_clear(hangul->preedit); @@ -1503,6 +1504,7 @@ ibus_hangul_engine_set_input_mode (IBusHangulEngine *hangul, int input_mode) prop = hangul->prop_hangul_mode; hangul->input_mode = input_mode; + g_debug("input_mode: %s", (input_mode == INPUT_MODE_HANGUL) ? "hangul" : "latin"); symbol = ibus_hangul_engine_get_input_mode_symbol (hangul, input_mode); ibus_property_set_symbol(prop, symbol); @@ -139,6 +139,14 @@ main (gint argc, gchar **argv) exit (-1); } + if (verbose) { + const gchar* value = g_getenv ("G_MESSAGES_DEBUG"); + if (value == NULL) { + g_setenv ("G_MESSAGES_DEBUG", "all", TRUE); + } + } + start_component (); + return 0; } |