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

Error even when using const char* #3215

Open
WeleSS2 opened this issue Oct 13, 2024 · 3 comments
Open

Error even when using const char* #3215

WeleSS2 opened this issue Oct 13, 2024 · 3 comments

Comments

@WeleSS2
Copy link

WeleSS2 commented Oct 13, 2024

This is first library where i can't even use const char* as string...

    const char* tt = "test {}";

    spdlog::debug(tt, std::source_location::current().file_name());

Is throwing a nice error
image

NOthing in docs of fmt work, any way to solve it or i just need to abandon fmt and spd?

@tt4g
Copy link
Contributor

tt4g commented Oct 13, 2024

Use fmt::runtime() to avoid compile-time-check: https://fmt.dev/11.0/api/#compile-time-checks

     const char* tt = "test {}";

-    spdlog::debug(tt, std::source_location::current().file_name());
+    spdlog::debug(fmt::runtime(tt), std::source_location::current().file_name());

@WeleSS2
Copy link
Author

WeleSS2 commented Oct 13, 2024

Finally working solution! Thanks a lot tt4g! You can close this issue, i was sitting over it nearly 2 weeks and wanted to abandon spd and fmt.

@tt4g
Copy link
Contributor

tt4g commented Oct 14, 2024

Please please close this issue.
I can't close this issue because I'm not the maintainer of this repository.

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

2 participants