My understanding of this is that the file will be limited to the specified size. But I don't understand the max_files = 3
, are we going to
have one or three files?
I run the example here and got one file.
#include <iostream>
#include "spdlog/sinks/rotating_file_sink.h"
void rotating_example()
{
// Create a file rotating logger with 5mb size max and 3 rotated files
auto max_size = 1048576 * 5;
auto max_files = 3;
auto logger = spdlog::rotating_logger_mt("some_logger_name", "logs/rotating.txt", max_size, max_files);
logger->info("loggers can be retrieved from a global registry using the spdlog::get(logger_name)");
}
int main()
{
rotating_example();
return 0;
}