Skip to content

The documentation comments are not matching the codeΒ #3370

@zurex

Description

@zurex

Describe your environment
N/A
Steps to reproduce
N/A

What is the expected behavior?
documentation comments are match with code.

What is the actual behavior?
A lot of comments do not match with the code.
For example:

/**
   * Writes a log with a severity of debug.
   * @tparam args Arguments which can be used to set data of log record by type.
   *  string_view                             -> body
   *  AttributeValue                          -> body
   *  SpanContext                             -> span_id,trace_id and trace_flags
   *  SpanId                                  -> span_id
   *  TraceId                                 -> trace_id
   *  TraceFlags                              -> trace_flags
   *  SystemTimestamp                         -> timestamp
   *  system_clock::time_point                -> timestamp
   *  KeyValueIterable                        -> attributes
   *  Key value iterable container            -> attributes
   *  span<pair<string_view, AttributeValue>> -> attributes(return type of MakeAttributes)
   */
  template <class... ArgumentType>
  void Debug(ArgumentType &&...args) noexcept
  {
    static_assert(
        !detail::LogRecordHasType<Severity, typename std::decay<ArgumentType>::type...>::value,
        "Severity is already set.");
    this->EmitLogRecord(Severity::kDebug, std::forward<ArgumentType>(args)...);
  }

In this case, it should be @param args .

Additional context
I will list all the similar error bellow and fix them one by one with separated PRs.

  • opentelemetry-cpp/api/include/opentelemetry/logs/logger.h

What's more, we should add some check to prevent these cases.

Metadata

Metadata

Assignees

Labels

area:docsDocumentationtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions