diff options
author | Forest <forestix@sonic.net> | 2022-08-23 12:47:52 -0700 |
---|---|---|
committer | Forest <forestix@sonic.net> | 2022-09-10 18:28:44 -0700 |
commit | 80f7683a577357e59ec9ca557b79bbfb03b489e2 (patch) | |
tree | 40bb5e3ea1470fbe1827cdbc305b58ff1105439a /src/Logging.h | |
parent | Bump mtxclient to released version (diff) | |
download | nheko-80f7683a577357e59ec9ca557b79bbfb03b489e2.tar.xz |
Control logging via command line and environment variables
Nheko is very chatty in its log output, generating log noise (which complicates diagnostics) and needless disk writes (which affect power consumption and SSD life). This patch introduces command line options and environment variables to control log levels and output type. The old --debug command line option still works, at least for now. It is overridden by the new command line options when they are used. Partially addresses #665.
Diffstat (limited to 'src/Logging.h')
-rw-r--r-- | src/Logging.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Logging.h b/src/Logging.h index 4a5109a6..23ff8236 100644 --- a/src/Logging.h +++ b/src/Logging.h @@ -6,11 +6,15 @@ #pragma once #include <memory> -#include <spdlog/logger.h> +#include <string> + +#include <QString> + +#include "spdlog/logger.h" namespace nhlog { void -init(const std::string &file); +init(const QString &level, const QString &path, bool to_stderr); std::shared_ptr<spdlog::logger> ui(); @@ -27,5 +31,4 @@ crypto(); std::shared_ptr<spdlog::logger> qml(); -extern bool enable_debug_log_from_commandline; } |