Skip to content

Commit

Permalink
Merge pull request #2375 from kslattery/bugfix/default_file_event_han…
Browse files Browse the repository at this point in the history
…dlers

Add default file-event_handler callbacks. #2374
  • Loading branch information
gabime authored May 13, 2022
2 parents 128cbe5 + d89a1e6 commit e05b854
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/spdlog/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ struct source_loc

struct file_event_handlers
{
file_event_handlers()
: before_open([](spdlog::filename_t) {})
, after_open ([](spdlog::filename_t, std::FILE*) {})
, before_close([](spdlog::filename_t, std::FILE*) {})
, after_close([](spdlog::filename_t) {})
{}

std::function<void(const filename_t &filename)> before_open;
std::function<void(const filename_t &filename, std::FILE *file_stream)> after_open;
std::function<void(const filename_t &filename, std::FILE *file_stream)> before_close;
Expand Down

0 comments on commit e05b854

Please sign in to comment.