userver: logging::TelemetrySettings Struct Reference
Loading...
Searching...
No Matches
logging::TelemetrySettings Struct Referencefinal

#include <userver/logging/telemetry_settings.hpp>

Detailed Description

Settings for one logger. Default values impose no additional restrictions.

Definition at line 15 of file telemetry_settings.hpp.

Public Member Functions

TelemetrySettings Merge (const TelemetrySettings &other) const
void Validate () const
bool operator== (const TelemetrySettings &) const =default
 Compares all settings.

Public Attributes

Level min_log_level {Level::kTrace}
 Minimum severity, combined with the logger's level captured at registration.
double log_sample_rate {1.0}
 Fraction of logs below warning to retain, in [0, 1]; excludes spans and force-enabled logs.

Member Function Documentation

◆ Merge()

TelemetrySettings logging::TelemetrySettings::Merge ( const TelemetrySettings & other) const
nodiscard

Returns the higher minimum level and lower sampling rate without modifying either input. Both inputs must satisfy logging::TelemetrySettings::Validate.

◆ Validate()

void logging::TelemetrySettings::Validate ( ) const
Exceptions
std::runtime_errorif the sampling rate is non-finite or outside [0, 1].

Member Data Documentation

◆ log_sample_rate

double logging::TelemetrySettings::log_sample_rate {1.0}

Fraction of logs below warning to retain, in [0, 1]; excludes spans and force-enabled logs.

Definition at line 19 of file telemetry_settings.hpp.

◆ min_log_level

Level logging::TelemetrySettings::min_log_level {Level::kTrace}

Minimum severity, combined with the logger's level captured at registration.

Definition at line 17 of file telemetry_settings.hpp.


The documentation for this struct was generated from the following file: