diff --git a/otlp/src/otlp/logs/logger.cpp b/otlp/src/otlp/logs/logger.cpp index ee5b17e72a30..6557d0728763 100644 --- a/otlp/src/otlp/logs/logger.cpp +++ b/otlp/src/otlp/logs/logger.cpp @@ -14,6 +14,7 @@ #include #include #include +#include USERVER_NAMESPACE_BEGIN @@ -230,10 +231,10 @@ void Logger::SendingLoop(Queue::Consumer& consumer, LogClient& log_client, Trace ); } while (consumer.Pop(action, deadline)); - if (config_.logs_sink == SinkType::kBoth || config_.logs_sink == SinkType::kOtlp) { + if (utils::UnderlyingValue(config_.logs_sink) & utils::UnderlyingValue(SinkType::kOtlp)) { DoLog(log_request, log_client); } - if (config_.tracing_sink == SinkType::kBoth || config_.tracing_sink == SinkType::kOtlp) { + if (utils::UnderlyingValue(config_.tracing_sink) & utils::UnderlyingValue(SinkType::kOtlp)) { DoTrace(trace_request, trace_client); } } diff --git a/otlp/src/otlp/logs/logger.hpp b/otlp/src/otlp/logs/logger.hpp index 2c0040ac8481..e76e31d1beb9 100644 --- a/otlp/src/otlp/logs/logger.hpp +++ b/otlp/src/otlp/logs/logger.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -17,7 +18,11 @@ USERVER_NAMESPACE_BEGIN namespace otlp { -enum class SinkType { kBoth, kDefault, kOtlp }; +enum class SinkType : std::uint8_t { + kDefault = 0x1, + kOtlp = 0x2, + kBoth = kDefault | kOtlp, +}; SinkType Parse(const yaml_config::YamlConfig& value, formats::parse::To);