orc icon indicating copy to clipboard operation
orc copied to clipboard

Duplicate Output

Open leethomason opened this issue 3 years ago • 0 comments

Describe the bug

If logging is used, ORC outputs to multiple streams, which causes the number of ODRVs reported to be doubled.

info: ORC complete.
info:   537 ODRVs reported

becomes:

info: ORC complete.
info:   1074 ODRVs reported

Expected behavior

The problem is straightforward: ++globals::instance()._odrv_count; in std::ostream& operator<<(std::ostream& s, const odrv_report& report) is called twice when there is logging.

But the actual issue IMO is that we have filter logic and side effects in operator<<. operator<< should:

  • have no side effects
  • only output - not filter

Fixing this will take some moderate refactoring.

leethomason avatar Jul 01 '22 16:07 leethomason