Try std::string_view instead · Issue #53 · PlatformLab/NanoLog · GitHub
Skip to content

Try std::string_view instead  #53

Open

Description

@KevinSmild

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions