Remove debug messages

This commit is contained in:
Mutzi 2023-10-23 13:59:50 +02:00
parent 600a4a48b8
commit ee059a9747
Signed by: root
GPG Key ID: 2437494E09F13876
4 changed files with 4 additions and 2 deletions

View File

@ -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;
};

View File

@ -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);

View File

@ -21,6 +21,7 @@ void signal_shutdown(const int) {
}
int main() {
// TODO add current timestamp to log name
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("log.txt");
spdlog::default_logger()->sinks().push_back(file_sink);
spdlog::set_level(spdlog::level::trace);

View File

@ -5,9 +5,11 @@
#include <spdlog/spdlog.h>
// 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();
}