diff options
author | James Booth <boothj5@gmail.com> | 2012-08-19 03:43:18 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-08-19 03:43:18 +0100 |
commit | e698738745367820e2e4bef8031c91a2a21e700a (patch) | |
tree | e4fca509a11070403d5baffe47b9543d53afb3b3 /src/main.c | |
parent | 74a88ad566989ef91641d0e8b95120bc6a66accd (diff) | |
download | profani-tty-e698738745367820e2e4bef8031c91a2a21e700a.tar.gz |
Customisable logging levels
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index 5e1ef9c5..8c696fdc 100644 --- a/src/main.c +++ b/src/main.c @@ -30,6 +30,7 @@ static gboolean disable_tls = FALSE; static gboolean version = FALSE; +static char *log = "INFO"; int main(int argc, char **argv) @@ -38,6 +39,7 @@ main(int argc, char **argv) { { "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Show version information", NULL }, { "disable-tls", 'd', 0, G_OPTION_ARG_NONE, &disable_tls, "Disable TLS", NULL }, + { "log",'l', 0, G_OPTION_ARG_STRING, &log, "Set logging levels, DEBUG, INFO (default), WARN, ERROR", "LEVEL" }, { NULL } }; @@ -46,7 +48,6 @@ main(int argc, char **argv) context = g_option_context_new(NULL); g_option_context_add_main_entries(context, entries, NULL); - //g_option_context_add_group(context, gtk_get_option_group (TRUE)); if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("%s\n", error->message); return 1; @@ -64,7 +65,7 @@ main(int argc, char **argv) return 0; } - profanity_init(disable_tls); + profanity_init(disable_tls, log); profanity_run(); return 0; |