1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1386 from DebXWoody/master

Rework logging
This commit is contained in:
Michael Vetter 2020-07-06 10:45:43 +02:00 committed by GitHub
commit 6113dfcb73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -232,8 +232,8 @@ log_level_from_string(char *log_level)
return PROF_LEVEL_WARN;
} else if (strcmp(log_level, "ERROR") == 0) {
return PROF_LEVEL_ERROR;
} else { // default to info
return PROF_LEVEL_INFO;
} else { // default logging is warn
return PROF_LEVEL_WARN;
}
}

View File

@ -78,7 +78,7 @@ main(int argc, char **argv)
{
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Show version information", NULL },
{ "account", 'a', 0, G_OPTION_ARG_STRING, &account_name, "Auto connect to an account on startup" },
{ "log", 'l', 0, G_OPTION_ARG_STRING, &log, "Set logging levels, DEBUG, INFO (default), WARN, ERROR", "LEVEL" },
{ "log", 'l', 0, G_OPTION_ARG_STRING, &log, "Set logging levels, DEBUG, INFO, WARN (default), ERROR", "LEVEL" },
{ "config", 'c', 0, G_OPTION_ARG_STRING, &config_file, "Use an alternative configuration file", NULL },
{ "logfile", 'f', 0, G_OPTION_ARG_STRING, &log_file, "Specify log filename", NULL },
{ "theme", 't', 0, G_OPTION_ARG_STRING, &theme_name, "Specify theme name", NULL },
@ -177,7 +177,8 @@ main(int argc, char **argv)
return 0;
}
prof_run(log ? log : "INFO", account_name, config_file, log_file, theme_name);
/* Default logging WARN */
prof_run(log ? log : "WARN", account_name, config_file, log_file, theme_name);
/* Free resources allocated by GOptionContext */
g_free(log);