mirror of
https://github.com/CDevJoud/Minecraft-Community-Edition.git
synced 2026-07-16 03:00:47 +00:00
Add documentation
This commit is contained in:
@@ -36,21 +36,37 @@ namespace MCE {
|
||||
void addSink(const eastl::shared_ptr<LoggerSink>& 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 <typename... Args>
|
||||
void info(std::format_string<Args...> format, 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>
|
||||
void warn(std::format_string<Args...> format, 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>
|
||||
void error(std::format_string<Args...> format, 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>
|
||||
void debug(std::format_string<Args...> format, Args&&... args) {
|
||||
log(LogLevel::DEBUG, std::format(format, std::forward<Args>(args)...));
|
||||
|
||||
Reference in New Issue
Block a user