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

Full logger implementation uses noexcept for methods that can throw exceptions #87

Open
AdamStepan opened this issue Aug 14, 2018 · 3 comments

Comments

@AdamStepan
Copy link
Contributor

AdamStepan commented Aug 14, 2018

Methods look like this:

virtual void log*(std::uint_fast64_t poolId) const noexcept override
{
    SpinGuard guard{lock};
    std::cerr << stringify("Pool [", poolId, "]: *") << std::flush;
}

But operator<< is not noexcept.

@MrWarlockX
Copy link
Contributor

I suggest using printf functions instead of iostreams, since printf function family are noexcept by default.

@majcl
Copy link
Contributor

majcl commented Apr 16, 2019

iostreams doesnt throw exceptions by default

@AdamStepan
Copy link
Contributor Author

Yes, but you don't have a guarantee that someone didn't enable them via exceptions method. So, these methods are not noexcept (https://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt)

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

No branches or pull requests

3 participants