#pragma once #include #include namespace utils { std::vector backtrace(int max_depth = 255); std::vector backtrace_symbols(const std::vector& stack); FORCE_INLINE void print_trace(logs::channel& logger, int max_depth = 255) { const auto trace = backtrace(max_depth); const auto lines = backtrace_symbols(trace); for (const auto& line : lines) { logger.error("%s", line); } } }