Skip to content

Commit

Permalink
fix(Logger): try to fmt runtime since it's not constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
spjuanjoc committed Jul 15, 2023
1 parent c466a01 commit 64ee381
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/Core/Logging/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ void Warn(const FormatString& fmt, Args&&... args)
}

template<typename FormatString, typename... Args>
void Error(FormatString&& format_string, Args&&... args)
void Error(const FormatString& fmt, Args&&... args)
{
SpdLogger::get();
spdlog::get(LOGGER_NAME)->error(std::forward<FormatString>(format_string), std::forward<Args>(args)...);
spdlog::get(LOGGER_NAME)->error(fmt::runtime(fmt), std::forward<Args>(args)...);
}

template<typename FormatString, typename... Args>
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ int
main(int argc, const char* argv[])
{
Logger::Info(">>main");
Logger::Error("test {} {}", "error", "string");
auto args = Core::parseArguments(argc, argv);
Logger::SpdLogger::get().setLevel(args.level);

Expand Down

0 comments on commit 64ee381

Please sign in to comment.