Skip to content

A5-1-1: Expand set of logging mechanisms #216

Closed
@lcartey

Description

@lcartey

Affected rules

  • A5-1-1

Description

This query is producing false positives because we are flagging legitimate logging or print calls. We should add support for the following:

  • Use of std::ostream and other supported function in a variable template - see the example below.
  • Exclude results expanded from a logging macro (based on the name of the macro)

Optional extension:

  • Ensure we capture wrappers around logging functions (i.e. functions that pass arguments only a logger or printf call should be consider, themselves, logger calls).

Example

template <typename T>
void PrintFoo(std::ostream& os, const T& bar, const char* str) noexcept {
  const Foo& foo{GetFoo(bar)};
  os << str << "blah blah" << foo << "blah blah" << bar.baz << ".";
}

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Highfalse positive/false negativeAn issue related to observed false positives or false negatives.top-25-fps

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions