From 2b9c44c916090b7d1b52454cbcf5136b8a580246 Mon Sep 17 00:00:00 2001 From: BendedWills Date: Thu, 5 Mar 2026 19:09:19 -0600 Subject: [PATCH] Add documentation --- Minecraft-Community-Edition/IO/Logger.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Minecraft-Community-Edition/IO/Logger.hpp b/Minecraft-Community-Edition/IO/Logger.hpp index da285e0..fafae3b 100644 --- a/Minecraft-Community-Edition/IO/Logger.hpp +++ b/Minecraft-Community-Edition/IO/Logger.hpp @@ -36,21 +36,37 @@ namespace MCE { void addSink(const eastl::shared_ptr& sink); void log(LogLevel level, std::string_view message); + /// Logs a given string with the LogLeve::INFO level + /// For example: Logger::info("Hello, {}", "world!") + /// @param format A std::format_string containing the formatting of the message + /// @param args The paramaters to be passed to std::format when formatting the message template void info(std::format_string format, Args&&... args) { log(LogLevel::INFO, std::format(format, std::forward(args)...)); } - + + /// Logs a given string with the LogLeve::WARN level + /// For example: Logger::warn("Hello, {}", "world!") + /// @param format A std::format_string containing the formatting of the message + /// @param args The paramaters to be passed to std::format when formatting the message template void warn(std::format_string format, Args&&... args) { log(LogLevel::WARN, std::format(format, std::forward(args)...)); } + /// Logs a given string with the LogLeve::ERROR level + /// For example: Logger::error("Hello, {}", "world!") + /// @param format A std::format_string containing the formatting of the message + /// @param args The paramaters to be passed to std::format when formatting the message template void error(std::format_string format, Args&&... args) { log(LogLevel::ERROR, std::format(format, std::forward(args)...)); } + /// Logs a given string with the LogLeve::DEBUG level + /// For example: Logger::debug("Hello, {}", "world!") + /// @param format A std::format_string containing the formatting of the message + /// @param args The paramaters to be passed to std::format when formatting the message template void debug(std::format_string format, Args&&... args) { log(LogLevel::DEBUG, std::format(format, std::forward(args)...));