mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-24 06:32:06 +08:00
add max files for rotating days
This commit is contained in:
parent
46fcd2e844
commit
34cc3419fa
@ -105,14 +105,15 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void init_filenames_q()
|
void init_filenames_q()
|
||||||
{
|
{
|
||||||
using details::os::file_exists;
|
using details::os::path_exists;
|
||||||
|
|
||||||
filenames_q_ = details::circular_q<filename_t>(static_cast<size_t>(max_files_));
|
filenames_q_ = details::circular_q<filename_t>(static_cast<size_t>(max_files_));
|
||||||
std::vector<filename_t> filenames;
|
std::vector<filename_t> filenames;
|
||||||
auto now = log_clock::now();
|
auto now = log_clock::now();
|
||||||
while (filenames.size() < max_files_)
|
while (filenames.size() < max_files_)
|
||||||
{
|
{
|
||||||
auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now));
|
auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now));
|
||||||
if (!file_exists(filename))
|
if (!path_exists(filename))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user