userver: userver/server/handlers/log_level.hpp Source File
Loading...
Searching...
No Matches
log_level.hpp
Go to the documentation of this file.
1#pragma once
2
5
9
10USERVER_NAMESPACE_BEGIN
11
12namespace components {
13class Logging;
14} // namespace components
15
16namespace server::handlers {
45class LogLevel final : public HttpHandlerBase {
46public:
47 LogLevel(const components::ComponentConfig& config, const components::ComponentContext& component_context);
48
51 static constexpr std::string_view kName = "handler-log-level";
52
54
56
57private:
58 std::string ProcessGet(const http::HttpRequest& request, request::RequestContext&) const;
59 std::string ProcessPut(const http::HttpRequest& request, request::RequestContext&) const;
60
61 components::Logging& logging_component_;
62 struct Data {
63 logging::Level default_init_level;
64 mutable std::unordered_map<std::string, logging::Level> init_levels;
65 };
67};
68
69} // namespace server::handlers
70
71template <>
73
74USERVER_NAMESPACE_END