mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 09:16:22 +00:00
Allow setting custom log file via -f FILENAME
`profanity -f TEST` will use `~/.local/share/profanity/logs/TEST.log` as the log file.
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
#include "omemo/omemo.h"
|
||||
#endif
|
||||
|
||||
static void _init(char *log_level, char *config_file);
|
||||
static void _init(char *log_level, char *config_file, char *log_file);
|
||||
static void _shutdown(void);
|
||||
static void _connect_default(const char * const account);
|
||||
|
||||
@@ -94,9 +94,9 @@ static gboolean cont = TRUE;
|
||||
static gboolean force_quit = FALSE;
|
||||
|
||||
void
|
||||
prof_run(char *log_level, char *account_name, char *config_file)
|
||||
prof_run(char *log_level, char *account_name, char *config_file, char *log_file)
|
||||
{
|
||||
_init(log_level, config_file);
|
||||
_init(log_level, config_file, log_file);
|
||||
plugins_on_start();
|
||||
_connect_default(account_name);
|
||||
|
||||
@@ -157,7 +157,7 @@ _connect_default(const char *const account)
|
||||
}
|
||||
|
||||
static void
|
||||
_init(char *log_level, char *config_file)
|
||||
_init(char *log_level, char *config_file, char *log_file)
|
||||
{
|
||||
setlocale(LC_ALL, "");
|
||||
// ignore SIGPIPE
|
||||
@@ -173,7 +173,7 @@ _init(char *log_level, char *config_file)
|
||||
files_create_directories();
|
||||
log_level_t prof_log_level = log_level_from_string(log_level);
|
||||
prefs_load(config_file);
|
||||
log_init(prof_log_level);
|
||||
log_init(prof_log_level, log_file);
|
||||
log_stderr_init(PROF_LEVEL_ERROR);
|
||||
if (strcmp(PACKAGE_STATUS, "development") == 0) {
|
||||
#ifdef HAVE_GIT_VERSION
|
||||
|
||||
Reference in New Issue
Block a user