spdlog icon indicating copy to clipboard operation
spdlog copied to clipboard

cannot use daily_logger_mt with max_files parameter

Open raceregos opened this issue 3 years ago • 1 comments

Hello everyone, I'm a bit confused about daily log files. What I wanna do is to log the last 48 hours and then rotate. So I implemented the following code:

auto logger = daily_logger_format_mt("daily_logger", "logs/daily.log", 0, 0, false, 2);

But I get the error:

/home/my_username/spdlog/include/spdlog/sinks/daily_file_sink.h:10:10: fatal error: spdlog/fmt/chrono.h: No such file or directory
   10 | #include <spdlog/fmt/chrono.h>
      |          ^~~~~~~~~~~~~~~~~~~~~

I'm not sure to change the include paths. Because it is not limited with chrono.h.

raceregos avatar Sep 09 '22 10:09 raceregos

It is not a spdlog problem because the header file spdlog/fmt/chrono.h is missing from the include path. Please check the include path of your project.

TIP: sometimes different versions of spdlog are installed on a system, causing problems.

tt4g avatar Sep 09 '22 11:09 tt4g