From 7a52b029ec9b124df0a9f09bbad6da7ffa358f33 Mon Sep 17 00:00:00 2001 From: Michael Bonani Date: Tue, 21 Dec 2021 17:12:17 +0100 Subject: [PATCH] TDM reduce log info --- aseba/thymio-device-manager/log.cpp | 4 ++++ aseba/thymio-device-manager/log.h | 2 ++ aseba/thymio-device-manager/main.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/aseba/thymio-device-manager/log.cpp b/aseba/thymio-device-manager/log.cpp index 5072b00f1..774db430f 100644 --- a/aseba/thymio-device-manager/log.cpp +++ b/aseba/thymio-device-manager/log.cpp @@ -22,6 +22,10 @@ std::string mobsya::log_filename(const char* path) { return str; } +void mobsya::setLogLevel(spdlog::level::level_enum level) { + mobsya::logger->set_level(level); +} + #if WIN32 std::string mobsya::get_last_win32_error_string() { std::string str; diff --git a/aseba/thymio-device-manager/log.h b/aseba/thymio-device-manager/log.h index 7001eca57..51b250639 100644 --- a/aseba/thymio-device-manager/log.h +++ b/aseba/thymio-device-manager/log.h @@ -18,6 +18,8 @@ void log(spdlog::level::level_enum level, const char* file, int line, const char level, fmt::format("{}@L{}:\t{}", mobsya::log_filename(file), line, fmt::format(message, args...)).c_str()); } +void setLogLevel(spdlog::level::level_enum level); + } // namespace mobsya #define _mobsya_CONCAT2(A, B) A##B #define _mobsya_CONCAT(A, B) _mobsya_CONCAT2(A, B) diff --git a/aseba/thymio-device-manager/main.cpp b/aseba/thymio-device-manager/main.cpp index b0d8533bf..e791f0b3f 100644 --- a/aseba/thymio-device-manager/main.cpp +++ b/aseba/thymio-device-manager/main.cpp @@ -167,6 +167,7 @@ options parse_options(int argc, char** argv) { } int main(int argc, char** argv) { + mobsya::setLogLevel(spdlog::level::info); auto opts = parse_options(argc, argv); try { return start(opts);