16 lines
415 B
C++
16 lines
415 B
C++
|
#ifndef FILESERVER_CRASH_HXX
|
||
|
#define FILESERVER_CRASH_HXX
|
||
|
|
||
|
#include <source_location>
|
||
|
#include <spdlog/spdlog.h>
|
||
|
|
||
|
// TODO implement backtrace
|
||
|
[[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::shutdown();
|
||
|
std::abort();
|
||
|
}
|
||
|
|
||
|
#endif //FILESERVER_CRASH_HXX
|