userver: userver/components/logging_configurator.hpp Source File
Loading...
Searching...
No Matches
logging_configurator.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <memory>
7#include <string_view>
8
13
14#include <dynamic_config/variables/USERVER_LOG_DYNAMIC_DEBUG.hpp>
15
16USERVER_NAMESPACE_BEGIN
17
18namespace logging {
19struct DynamicDebugConfig;
20struct TelemetryConfig;
21} // namespace logging
22
23namespace components {
24
46class LoggingConfigurator final : public RawComponentBase {
47public:
50 static constexpr std::string_view kName = "logging-configurator";
51
52 LoggingConfigurator(const ComponentConfig& config, const ComponentContext& context);
53
54 ~LoggingConfigurator() override;
55
62
63 static yaml_config::Schema GetStaticConfigSchema();
64
65private:
66 class TelemetryState;
67
68 void OnConfigUpdate(const dynamic_config::Diff& diff);
69
70 utils::statistics::MetricsStoragePtr metrics_storage_;
71 const std::unique_ptr<TelemetryState> telemetry_;
72};
73
75
76template <>
77inline constexpr bool kHasValidate<LoggingConfigurator> = true;
78
79} // namespace components
80
81USERVER_NAMESPACE_END