Config option to limit the number of log files

This commit is contained in:
Dmitry K 2025-01-22 13:55:36 +00:00 committed by Adam Honse
parent fc65a01a60
commit 894d792e23
2 changed files with 124 additions and 8 deletions

View file

@ -60,7 +60,7 @@ private:
LogManager(const LogManager&) = delete;
LogManager(LogManager&&) = delete;
~LogManager();
std::mutex entry_mutex;
std::recursive_mutex entry_mutex;
std::mutex section_mutex;
std::ofstream log_stream;
@ -91,6 +91,8 @@ private:
// A non-guarded flush()
void _flush();
void rotate_logs(const filesystem::path& folder, const filesystem::path& templ, int max_count);
public:
static LogManager* get();
void configure(json config, const filesystem::path & defaultDir);