From 6a11db9a2ec5810747e2343b34d531de417d0622 Mon Sep 17 00:00:00 2001 From: illyum Date: Sun, 15 Sep 2024 04:32:46 -0600 Subject: [PATCH] feat(logging): add extra logging streams --- engine/src/core/Logger.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/src/core/Logger.hpp b/engine/src/core/Logger.hpp index 971da9a..74bbf3d 100644 --- a/engine/src/core/Logger.hpp +++ b/engine/src/core/Logger.hpp @@ -32,8 +32,14 @@ namespace ICEngine { this->level = level; } + void AddStream(std::ostream * stream) { + this->streams.push_back(stream); + } + template void Log(LogLevel level, const char *file, int line, const char *func, const std::string &formatStr, Args &&... args) { + // TODO: Create a crash handler and manage fatal messages separately (creates crashdump) + // TODO: Allow user to create their own class that inherits Fatal Handler so they can implement it themselves if (level < this->level) return; std::string formattedMessage = format(formatStr, std::forward(args)...); std::string logMessage = formatMessage(level, file, line, func, formattedMessage);