file_event_handlers add before_open function

This commit is contained in:
seker
2021-11-13 17:19:23 +08:00
parent ff9313e6dd
commit 24a551c14e
8 changed files with 29 additions and 17 deletions

View File

@@ -121,7 +121,11 @@ void rotating_example()
{
// Create a file rotating logger with 5mb size max and 3 rotated files.
spdlog::file_event_handlers_t file_event_handlers;
file_event_handlers.after_open = [](spdlog::filename_t filename, std::FILE* fstream)
file_event_handlers.before_open = [](spdlog::filename_t filename)
{
spdlog::info("basic_example() : file_event_handlers.before_open : {}", filename.c_str());
};
file_event_handlers.after_open = [](spdlog::filename_t filename, std::FILE* fstream)
{
fputs("OPEN!\r\n", fstream);
spdlog::info("basic_example() : file_event_handlers.after_open : {}", filename.c_str());