Skip to content

Commit

Permalink
refactor: logging function logics
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Aug 8, 2024
1 parent 71a14ff commit 77f22d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/endstone/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,37 +88,37 @@ class Logger {
template <typename... Args>
void trace(const fmt::format_string<Args...> format, Args &&...args) const
{
log(Level::Trace, fmt::format(format, std::forward<Args>(args)...));
log(Trace, format, std::forward<Args>(args)...);
}

template <typename... Args>
void debug(const fmt::format_string<Args...> format, Args &&...args) const
{
log(Level::Debug, fmt::format(format, std::forward<Args>(args)...));
log(Debug, format, std::forward<Args>(args)...);
}

template <typename... Args>
void info(const fmt::format_string<Args...> format, Args &&...args) const
{
log(Level::Info, fmt::format(format, std::forward<Args>(args)...));
log(Info, format, std::forward<Args>(args)...);
}

template <typename... Args>
void warning(const fmt::format_string<Args...> format, Args &&...args) const
{
log(Level::Warning, fmt::format(format, std::forward<Args>(args)...));
log(Warning, format, std::forward<Args>(args)...);
}

template <typename... Args>
void error(const fmt::format_string<Args...> format, Args &&...args) const
{
log(Level::Error, fmt::format(format, std::forward<Args>(args)...));
log(Error, format, std::forward<Args>(args)...);
}

template <typename... Args>
void critical(const fmt::format_string<Args...> format, Args &&...args) const
{
log(Level::Critical, fmt::format(format, std::forward<Args>(args)...));
log(Critical, format, std::forward<Args>(args)...);
}
};

Expand Down

0 comments on commit 77f22d4

Please sign in to comment.