TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25203 21
What do you use for logging in your C++ codebase? What are the pros/cons?

I've used Google's logging library in the past and I would give it a solid B- grade. It gets the job done. I really dislike the streaming operator, but meh it's not that bad. It just feels weird if I concatenate the string beforehand: LOG(INFO) << absl::StrCat(strs...);

As I embark on my new project, I want to make intelligent decisions about what idioms to favor. Logging is a big one, so I'd love to hear what people out there use.

In particular, if there is a library that uses reflection to give named arguments, that would be perfect! My ideal callsite would look like this:

my::LogInfo("Hello, {person}!", {
.person = GetPersonObject(),
});

It would also be cool to get assertions baked into it, though that complicates the design space.

Anyone wanna chime in?

https://redd.it/1tf4rri
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 3, 2026Lets explore the stack https://meetingcpp.com/blog/items/Lets-explore-the-stack.html https…
  2. Oct 3, 2026C++ Show and Tell - October 2026 Use this thread to share anything you've written in C++.…
  3. Oct 3, 2026C++ future at Adobe So if anyone was still curious what happened to Hylo, or where Adobe s…
  4. Oct 3, 2026C++ Jobs - Q4 2026 Rules For Individuals --------------------- * **Don't** create top-leve…
  5. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  6. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →