diff --git a/src/main.c b/src/main.c index f4ee711..56d7286 100644 --- a/src/main.c +++ b/src/main.c @@ -134,7 +134,7 @@ init_all() c = g_key_file_get_string(keyfile_get(), "core", "logging", &err); if (err != NULL) { if (err->code == G_KEY_FILE_ERROR_INVALID_VALUE) - g_warning("cannot turn logging on: %s", err->message); + g_warning("cannot turn logging to: %s", err->message); g_clear_error(&err); } else { diff --git a/src/ui-command.c b/src/ui-command.c index 0bc999d..f89e0e2 100644 --- a/src/ui-command.c +++ b/src/ui-command.c @@ -77,14 +77,9 @@ command_func_quit(gint argc, gchar ** argv) gboolean command_func_log(gint argc, gchar ** argv) { - if (argc > 2) - g_warning("usage: /log [on|off]"); - if (argc == 1) { - if (get_logging() == TRUE) - g_message("logging is on"); - else - g_message("logging is off"); - } + if (argc != 2) + g_warning("usage: /log [on|off|status]"); + if (argc == 2) set_logging(argv[1]); return 0; diff --git a/src/ui-logfile.c b/src/ui-logfile.c index 35a38c9..f0dc7d0 100644 --- a/src/ui-logfile.c +++ b/src/ui-logfile.c @@ -43,12 +43,22 @@ write_to_log(const gchar * account, const gchar * contact, const gchar * author, void set_logging(gchar * c) { - if (g_ascii_strcasecmp(c, "on") == 0) + if (g_ascii_strcasecmp(c, "on") == 0){ logging = TRUE; - else if (g_ascii_strcasecmp(c, "off") == 0) + g_message("Logging is on!"); + } + else if (g_ascii_strcasecmp(c, "off") == 0){ logging = FALSE; + g_message("Logging is off!"); + } + else if (g_ascii_strcasecmp(c,"status") == 0){ + if (logging == TRUE) + g_message("Logging is on!"); + else + g_message("Logging is off!"); + } else - logging = FALSE; + g_warning("usage: /log [on|off|status]"); } gboolean