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

Try std::string_view instead #53

Open
KevinSmild opened this issue Jan 21, 2021 · 0 comments
Open

Try std::string_view instead #53

KevinSmild opened this issue Jan 21, 2021 · 0 comments

Comments

@KevinSmild
Copy link

Hello,
Your logger implementation is really fast! Although we could not achieve the same performance as written in the documentation (maybe because of the difference in platform), it indeed outperform other loggers by far.

Now, I would like to make a small suggestion. I was trying to encapsulate the library inside of a class. Because of NanoLog's heavy dependency on constexpr, it was kind of cumbersome (just little tweaks here and there). To deal with the problem I changed the format string argument type from (&)[N] to std::string_view and it was easier to achieve my goal, without affecting performance.

My suggestion is just that: change (&)[N] to std::string_view.
With that in mind, I don't know if there is a better way of doing this, but using string_views is definitely a solution.

Thanks,
Kevin Baez.

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

1 participant