gabime / spdlog

Fast C++ logging library.
Other
24k stars 4.5k forks source link

Is spdlog can support placeholders %0 %1 like {0} {1} #3162

Closed xiaocai123123 closed 4 weeks ago

xiaocai123123 commented 4 weeks ago

How can spdlog support placeholders %0 %1 like {0} {1} ? I have a log that needs to be printed like below: spdlog::info("Welocome to spdlog %0 %1", 123, "test"); I want to print like below: spdlog::info("Welocome to spdlog {} {}", 123, "test"); How can i finish it?

tt4g commented 4 weeks ago

spdlog uses fmt library to format logging arguments, and fmt not supports %0 style (% is reserved by Chrono Format Specifications: https://fmt.dev/11.0/syntax/#chrono-format-specifications).

xiaocai123123 commented 4 weeks ago

fmt library

thanks! U are great!