1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-07-21 18:24:14 -04:00

Rework logging

Changed default logging from INFO to WARN.

Issue: #1353
This commit is contained in:
Stefan Kropp 2020-07-03 18:47:16 +02:00
parent 83ed9ba24b
commit b8207207f4
No known key found for this signature in database
GPG Key ID: C2DC916F35751C24
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);