glog icon indicating copy to clipboard operation
glog copied to clipboard

Provide API for logging with per-thread counters

Open boscosiu opened this issue 3 years ago • 1 comments

This is an RFC for a feature to allow counting loggers to use thread-local variables.

I'm writing task-based routines that spawn threads to repeatedly run a function or lambda. Currently only the thread that "wins" the shared count to N gets to log which is suboptimal for this use case.

It would be nice to be able to periodically report progress from each thread with independent counters for each task's loop.

If this is something we'd want to add, I'll follow up with docs and tests. Thanks for looking!

boscosiu avatar Nov 07 '22 14:11 boscosiu

Codecov Report

Merging #871 (023e45b) into master (05fbc65) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #871   +/-   ##
=======================================
  Coverage   73.29%   73.29%           
=======================================
  Files          17       17           
  Lines        3292     3292           
=======================================
  Hits         2413     2413           
  Misses        879      879           
Impacted Files Coverage Δ
src/glog/logging.h.in 80.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Nov 08 '22 08:11 codecov-commenter

Thanks for the PR. Given there are is no feedback and the PR heavily diverged from master we can abandon the changes. In case you want continue working on this, you can rebase anytime.

sergiud avatar Jun 11 '24 19:06 sergiud