Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_event_handlers add before_open function #2169

Merged
merged 1 commit into from
Nov 15, 2021
Merged

file_event_handlers add before_open function #2169

merged 1 commit into from
Nov 15, 2021

Conversation

seker
Copy link
Contributor

@seker seker commented Nov 13, 2021

file_event_handlers add before_open function

@gabime
Copy link
Owner

gabime commented Nov 13, 2021

why do we need before open?

@seker
Copy link
Contributor Author

seker commented Nov 15, 2021

why do we need before open?

in my project, i need to check avaliable disk spcace before open a log file while my app start up.

@@ -54,6 +54,11 @@ SPDLOG_INLINE void file_helper::open(const filename_t &fname, bool truncate)
}
std::fclose(tmp);
}

if (event_handlers_.before_open)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its better called before the loop, otherwise it would be calked multiple times

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

god, my mistake~~

fixed.

@gabime gabime merged commit a3ad8b5 into gabime:v1.x Nov 15, 2021
@seker seker deleted the v1.x_file_event_handlers branch May 5, 2022 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants