Remove debug messages
This commit is contained in:
		@@ -48,7 +48,7 @@ struct Token {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct Config {
 | 
					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;
 | 
					    std::uint16_t smtp_port, server_port;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,6 @@ SaveNode load_node(const rapidjson::Value &doc) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ASSIGN_MEMBER(node->id, id, Uint64);
 | 
					    ASSIGN_MEMBER(node->id, id, Uint64);
 | 
				
			||||||
    id = node->id;
 | 
					    id = node->id;
 | 
				
			||||||
    data_logger->debug("Loading node {}", id);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ASSIGN_MEMBER(node->name, name, String);
 | 
					    ASSIGN_MEMBER(node->name, name, String);
 | 
				
			||||||
    ASSIGN_MEMBER(node->file, file, Bool);
 | 
					    ASSIGN_MEMBER(node->file, file, Bool);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@ void signal_shutdown(const int) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main() {
 | 
					int main() {
 | 
				
			||||||
 | 
					    // TODO add current timestamp to log name
 | 
				
			||||||
    auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("log.txt");
 | 
					    auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>("log.txt");
 | 
				
			||||||
    spdlog::default_logger()->sinks().push_back(file_sink);
 | 
					    spdlog::default_logger()->sinks().push_back(file_sink);
 | 
				
			||||||
    spdlog::set_level(spdlog::level::trace);
 | 
					    spdlog::set_level(spdlog::level::trace);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,9 +5,11 @@
 | 
				
			|||||||
#include <spdlog/spdlog.h>
 | 
					#include <spdlog/spdlog.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// TODO implement backtrace
 | 
					// TODO implement backtrace
 | 
				
			||||||
 | 
					// TODO Send mail to admin on crash
 | 
				
			||||||
[[noreturn]]
 | 
					[[noreturn]]
 | 
				
			||||||
static void crash(std::source_location loc = std::source_location::current()) {
 | 
					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::critical("crash called from: {}:{} `{}`", loc.file_name(), loc.line(), loc.function_name());
 | 
				
			||||||
 | 
					    spdlog::details::registry::instance().flush_all();
 | 
				
			||||||
    spdlog::shutdown();
 | 
					    spdlog::shutdown();
 | 
				
			||||||
    std::abort();
 | 
					    std::abort();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user