Skip to content

How to put in log string + int? #2120

Answered by tt4g
maksglukhov asked this question in Q&A
Discussion options

You must be logged in to vote

fmt library is used to format log messages with arguments in spdlog.
Try it.

auto mylogger = spdlog::basic_logger_mt("logger", "logs/logs.txt");
mylogger->info("The number to guess is: {}", ran);

And see fmt documentation: https://fmt.dev/8.0.0/

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maksglukhov
Comment options

Answer selected by maksglukhov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants