Added default day format into the filename

pull/963/head
Nikola Gamzakov 7 years ago
parent 9acdd37d6a
commit 234d82bcd0

@ -13,6 +13,7 @@
#include "spdlog/details/null_mutex.h" #include "spdlog/details/null_mutex.h"
#include "spdlog/fmt/fmt.h" #include "spdlog/fmt/fmt.h"
#include "spdlog/sinks/base_sink.h" #include "spdlog/sinks/base_sink.h"
#include "spdlog/sinks/daily_file_sink.h"
#include <chrono> #include <chrono>
#include <cstdio> #include <cstdio>
@ -101,6 +102,11 @@ private:
fmt::format_to(wt, SPDLOG_FILENAME_T("{}_{}{}"), basename, formated_time(), ext); fmt::format_to(wt, SPDLOG_FILENAME_T("{}_{}{}"), basename, formated_time(), ext);
filename = fmt::to_string(wt); filename = fmt::to_string(wt);
} }
else
{
auto now = log_clock::now();
filename = daily_filename_calculator::calc_filename(base_filename_, now);
}
if (index != 0u) if (index != 0u)
{ {

Loading…
Cancel
Save