Add documentation

This commit is contained in:
BendedWills
2026-03-05 19:09:19 -06:00
parent 08f237d482
commit 2b9c44c916

View File

@@ -36,21 +36,37 @@ namespace MCE {
void addSink(const eastl::shared_ptr<LoggerSink>& sink); void addSink(const eastl::shared_ptr<LoggerSink>& sink);
void log(LogLevel level, std::string_view message); 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 <typename... Args> template <typename... Args>
void info(std::format_string<Args...> format, Args&&... args) { void info(std::format_string<Args...> format, Args&&... args) {
log(LogLevel::INFO, std::format(format, std::forward<Args>(args)...)); log(LogLevel::INFO, std::format(format, std::forward<Args>(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 <typename... Args> template <typename... Args>
void warn(std::format_string<Args...> format, Args&&... args) { void warn(std::format_string<Args...> format, Args&&... args) {
log(LogLevel::WARN, std::format(format, std::forward<Args>(args)...)); log(LogLevel::WARN, std::format(format, std::forward<Args>(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 <typename... Args> template <typename... Args>
void error(std::format_string<Args...> format, Args&&... args) { void error(std::format_string<Args...> format, Args&&... args) {
log(LogLevel::ERROR, std::format(format, std::forward<Args>(args)...)); log(LogLevel::ERROR, std::format(format, std::forward<Args>(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 <typename... Args> template <typename... Args>
void debug(std::format_string<Args...> format, Args&&... args) { void debug(std::format_string<Args...> format, Args&&... args) {
log(LogLevel::DEBUG, std::format(format, std::forward<Args>(args)...)); log(LogLevel::DEBUG, std::format(format, std::forward<Args>(args)...));