Skip to content

Commit

Permalink
Merge pull request #197 from EmixamPP/fix/fmt-compatibility
Browse files Browse the repository at this point in the history
fix: compatibility with fmt lib
  • Loading branch information
EmixamPP authored Oct 2, 2024
2 parents 788b91b + 1c9f922 commit 0c50261
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Wed Oct 2 2024 - 6.0.5
- Fix fmt lib compatibility
# Fri Sept 30 2024 - 6.0.4
- Fix tweak command crashes
# Sun Sept 1 2024 - 6.0.3
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'linux-enable-ir-emitter',
'cpp',
version: '6.0.4',
version: '6.0.5',
license: 'MIT',
default_options: [
'cpp_std=c++20',
Expand Down
14 changes: 7 additions & 7 deletions src/utils/logger.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <string_view>
using namespace std;

#include <spdlog/sinks/daily_file_sink.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>

Expand All @@ -29,7 +29,7 @@ inline void setup(bool verbose_console, bool enable_file) {
if (enable_file) // add file sink if possible
{
try {
auto file_sink = make_shared<spdlog::sinks::daily_file_format_sink_st>(LOG_FILE, 0, 0);
auto file_sink = make_shared<spdlog::sinks::basic_file_sink_st>(LOG_FILE);
file_sink->set_level(spdlog::level::debug);
file_sink->set_pattern("[%H:%M:%S] [%l] %v");

Expand All @@ -47,26 +47,26 @@ inline void setup(bool verbose_console, bool enable_file) {

template <typename... Args>
void debug(std::string_view fmt, Args &&...args) {
spdlog::debug(fmt, std::forward<Args>(args)...);
spdlog::debug(SPDLOG_FMT_RUNTIME(fmt), std::forward<Args>(args)...);
}

template <typename... Args>
void info(std::string_view fmt, Args &&...args) {
spdlog::info(fmt, std::forward<Args>(args)...);
spdlog::info(SPDLOG_FMT_RUNTIME(fmt), std::forward<Args>(args)...);
}

template <typename... Args>
void warn(std::string_view fmt, Args &&...args) {
spdlog::warn(fmt, std::forward<Args>(args)...);
spdlog::warn(SPDLOG_FMT_RUNTIME(fmt), std::forward<Args>(args)...);
}

template <typename... Args>
void error(std::string_view fmt, Args &&...args) {
spdlog::error(fmt, std::forward<Args>(args)...);
spdlog::error(SPDLOG_FMT_RUNTIME(fmt), std::forward<Args>(args)...);
}

template <typename... Args>
void critical(std::string_view fmt, Args &&...args) {
spdlog::critical(fmt, std::forward<Args>(args)...);
spdlog::critical(SPDLOG_FMT_RUNTIME(fmt), std::forward<Args>(args)...);
}
} // namespace logger

0 comments on commit 0c50261

Please sign in to comment.