From ed61b514898918c8fadd6d90b7cc703296abb42c Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 5 Aug 2025 18:49:41 +0200 Subject: [PATCH] Adding MultiLogger --- lib/std/core/logging.c3 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/std/core/logging.c3 b/lib/std/core/logging.c3 index bccf09361..c1bec7f28 100644 --- a/lib/std/core/logging.c3 +++ b/lib/std/core/logging.c3 @@ -169,6 +169,19 @@ struct NullLogger (Logger) fn void NullLogger.log(&self, LogPriority priority, LogCategory category, LogTag tag, String file, String function, int line, String fmt, any[] args) @dynamic {} +struct MultiLogger (Logger) +{ + Logger[] loggers; +} + +fn void MultiLogger.log(&self, LogPriority priority, LogCategory category, LogTag tag, String file, String function, int line, String fmt, any[] args) @dynamic +{ + foreach (logger : self.loggers) + { + logger.log(priority, category, tag, file, function, line, fmt, args); + } +} + module std::core::log @private; import std::io, std::thread, std::time;