From 80f7683a577357e59ec9ca557b79bbfb03b489e2 Mon Sep 17 00:00:00 2001 From: Forest Date: Tue, 23 Aug 2022 12:47:52 -0700 Subject: 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. --- src/Logging.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Logging.h') 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 -#include +#include + +#include + +#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 ui(); @@ -27,5 +31,4 @@ crypto(); std::shared_ptr qml(); -extern bool enable_debug_log_from_commandline; } -- cgit 1.4.1