From ee059a9747b9e2d618fa3b1285e94edcda16ac20 Mon Sep 17 00:00:00 2001 From: Mutzi Date: Mon, 23 Oct 2023 13:59:50 +0200 Subject: [PATCH] Remove debug messages --- src/data/data.hxx | 2 +- src/data/data_load.cxx | 1 - src/main.cxx | 1 + src/util/crash.hxx | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/data.hxx b/src/data/data.hxx index dc716e0..967abb3 100644 --- a/src/data/data.hxx +++ b/src/data/data.hxx @@ -48,7 +48,7 @@ struct Token { }; struct Config { - std::string smtp_host, smtp_user, smtp_pass, smtp_from, admin_mail; // TODO: Send mail to admin on crash + std::string smtp_host, smtp_user, smtp_pass, smtp_from, admin_mail; std::uint16_t smtp_port, server_port; }; diff --git a/src/data/data_load.cxx b/src/data/data_load.cxx index e6fa833..e39c1c0 100644 --- a/src/data/data_load.cxx +++ b/src/data/data_load.cxx @@ -17,7 +17,6 @@ SaveNode load_node(const rapidjson::Value &doc) { ASSIGN_MEMBER(node->id, id, Uint64); id = node->id; - data_logger->debug("Loading node {}", id); ASSIGN_MEMBER(node->name, name, String); ASSIGN_MEMBER(node->file, file, Bool); diff --git a/src/main.cxx b/src/main.cxx index 87e2805..d3366bd 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -21,6 +21,7 @@ void signal_shutdown(const int) { } int main() { + // TODO add current timestamp to log name auto file_sink = std::make_shared("log.txt"); spdlog::default_logger()->sinks().push_back(file_sink); spdlog::set_level(spdlog::level::trace); diff --git a/src/util/crash.hxx b/src/util/crash.hxx index 5254104..040cb25 100644 --- a/src/util/crash.hxx +++ b/src/util/crash.hxx @@ -5,9 +5,11 @@ #include // TODO implement backtrace +// TODO Send mail to admin on crash [[noreturn]] static void crash(std::source_location loc = std::source_location::current()) { spdlog::critical("crash called from: {}:{} `{}`", loc.file_name(), loc.line(), loc.function_name()); + spdlog::details::registry::instance().flush_all(); spdlog::shutdown(); std::abort(); }