Skip to content

Commit

Permalink
Add default file-event_handler callbacks. #2374
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Slattery committed May 13, 2022
1 parent 128cbe5 commit d89a1e6
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 d89a1e6

Please sign in to comment.