44#include <string_view>
55using namespace std;
66
7- #include <spdlog/sinks/daily_file_sink .h>
7+ #include <spdlog/sinks/basic_file_sink .h>
88#include <spdlog/sinks/stdout_color_sinks.h>
99#include <spdlog/spdlog.h>
1010
@@ -29,7 +29,7 @@ inline void setup(bool verbose_console, bool enable_file) {
2929 if (enable_file) // add file sink if possible
3030 {
3131 try {
32- auto file_sink = make_shared<spdlog::sinks::daily_file_format_sink_st >(LOG_FILE, 0, 0 );
32+ auto file_sink = make_shared<spdlog::sinks::basic_file_sink_st >(LOG_FILE);
3333 file_sink->set_level(spdlog::level::debug);
3434 file_sink->set_pattern("[%H:%M:%S] [%l] %v");
3535
@@ -47,26 +47,26 @@ inline void setup(bool verbose_console, bool enable_file) {
4747
4848template <typename... Args>
4949void debug(std::string_view fmt, Args &&...args) {
50- spdlog::debug(fmt, std::forward<Args>(args)...);
50+ spdlog::debug(SPDLOG_FMT_RUNTIME( fmt) , std::forward<Args>(args)...);
5151}
5252
5353template <typename... Args>
5454void info(std::string_view fmt, Args &&...args) {
55- spdlog::info(fmt, std::forward<Args>(args)...);
55+ spdlog::info(SPDLOG_FMT_RUNTIME( fmt) , std::forward<Args>(args)...);
5656}
5757
5858template <typename... Args>
5959void warn(std::string_view fmt, Args &&...args) {
60- spdlog::warn(fmt, std::forward<Args>(args)...);
60+ spdlog::warn(SPDLOG_FMT_RUNTIME( fmt) , std::forward<Args>(args)...);
6161}
6262
6363template <typename... Args>
6464void error(std::string_view fmt, Args &&...args) {
65- spdlog::error(fmt, std::forward<Args>(args)...);
65+ spdlog::error(SPDLOG_FMT_RUNTIME( fmt) , std::forward<Args>(args)...);
6666}
6767
6868template <typename... Args>
6969void critical(std::string_view fmt, Args &&...args) {
70- spdlog::critical(fmt, std::forward<Args>(args)...);
70+ spdlog::critical(SPDLOG_FMT_RUNTIME( fmt) , std::forward<Args>(args)...);
7171}
7272} // namespace logger
0 commit comments