userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
logging_configurator.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/components/logging_configurator.hpp
4
/// @brief @copybrief components::LoggingConfigurator
5
6
#
include
<
userver
/
components
/
component_fwd
.
hpp
>
7
#
include
<
userver
/
components
/
raw_component_base
.
hpp
>
8
#
include
<
userver
/
utils
/
statistics
/
fwd
.
hpp
>
9
10
#
include
<
dynamic_config
/
variables
/
USERVER_LOG_DYNAMIC_DEBUG
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
logging
{
15
struct
DynamicDebugConfig;
16
}
17
18
namespace
components
{
19
20
/// @ingroup userver_components
21
///
22
/// @brief Helper component to configure logging.
23
///
24
/// The functionality is not in Trace or Logger components because that
25
/// introduces circular dependency between Logger and DynamicConfig.
26
///
27
/// ## LoggingConfigurator Dynamic config
28
/// * @ref USERVER_LOG_DYNAMIC_DEBUG
29
/// * @ref USERVER_NO_LOG_SPANS
30
///
31
/// ## Static options of components::LoggingConfigurator :
32
/// @include{doc} scripts/docs/en/components_schema/core/src/components/logging_configurator.md
33
///
34
/// Options inherited from @ref components::ComponentBase :
35
/// @include{doc} scripts/docs/en/components_schema/core/src/components/impl/component_base.md
36
///
37
/// ## Config example:
38
///
39
/// @snippet core/src/components/common_component_list_test.cpp Sample logging configurator component config
40
class
LoggingConfigurator
final
:
public
RawComponentBase
{
41
public
:
42
/// @ingroup userver_component_names
43
/// @brief The default name of @ref components::LoggingConfigurator component
44
static
constexpr
std::string_view
kName
=
"logging-configurator"
;
45
46
LoggingConfigurator(
const
ComponentConfig& config,
const
ComponentContext& context);
47
48
static
yaml_config
::Schema GetStaticConfigSchema();
49
50
private
:
51
void
OnConfigUpdate(
const
dynamic_config::Snapshot& config);
52
53
utils
::
statistics
::MetricsStoragePtr metrics_storage_;
54
};
55
56
/// }@
57
58
template
<>
59
inline
constexpr
bool
kHasValidate
<
LoggingConfigurator
> =
true
;
60
61
}
// namespace components
62
63
USERVER_NAMESPACE_END
userver
components
logging_configurator.hpp
Generated on
for userver by
Doxygen
1.17.0