lintel 0.2.0
Loading...
Searching...
No Matches
LoggerComponent.h
Go to the documentation of this file.
1#ifndef LINTEL_LOGGERCOMPONENT_H
2#define LINTEL_LOGGERCOMPONENT_H
3
5#include <tinyxml2.h>
6
7#include <memory>
8
11
12namespace lintel {
15{
16private:
18 std::shared_ptr<EnvironmentConfiguration> m_environmentConfiguration;
19
21 static const struct Shapes
22 {
23 const char *const CONFIG_ROOT = "Loggers";
24 const char *const LOGGER_ROOT = "Logger";
25 const char *const LOGGER_PATTERN = "pattern";
26 const char *const LOGGER_LEVEL = "level";
27 const char *const LOGGER_ASYNC = "async";
28 const char *const LOGGER_PROCESS = "process_name";
29 const char *const LOGGER_SINK_ROOT = "LoggerSink";
30 const char *const LOGGER_SINK_TYPE = "type";
31 const char *const LOGGER_SINK_LEVEL = "level";
32 const char *const LOGGER_SINK_PATTERN = "pattern";
33 const char *const LOGGER_SINK_CONNECTION = "connection";
34 const char *const LOGGER_SINK_PORT = "port";
35 const char *const LOGGER_SINK_TIME = "time";
36 const char *const LOGGER_SINK_FILE_NAME = "file_name";
37 const char *const LOGGER_SINK_SIZE = "size";
38 const char *const LOGGER_SINK_MAX_FILES = "max_files";
39 const char *const LOGGER_SINK_ID = "id";
40 const char *const PATH_ROOT = "Path";
41 const char *const PATH_PATH = "path";
42 const char *const PATH_CREATE_PROCESS_SUB_DIR = "create_sub_dirs";
43 } shape;
44
49 std::shared_ptr<Entry> parseLoggerPath(tinyxml2::XMLElement *loggerElement, int32_t &lineNumber);
50
56 std::shared_ptr<Entry> parseLogger(tinyxml2::XMLElement *loggerElement, int32_t &lineNumber, int32_t lineOffset);
57
59 struct SinkDefaults
60 {
62 const char *level = nullptr;
64 const char *pattern = nullptr;
65 };
66
73 parseLoggerSink(tinyxml2::XMLElement *loggerSinkElement, int32_t lineNo, const SinkDefaults &defaults);
74
75public:
78 LoggerComponent(std::shared_ptr<EnvironmentConfiguration> environmentConfiguration);
79
85 std::vector<std::shared_ptr<Entry>>
86 parse(const std::string &content, int32_t lineOffset, const std::string &fileName) override;
87};
88
89}// namespace lintel
90#endif// LINTEL_LOGGERCOMPONENT_H
Definition Component.h:13
Definition LoggerComponent.h:15
LoggerComponent(std::shared_ptr< EnvironmentConfiguration > environmentConfiguration)
std::vector< std::shared_ptr< Entry > > parse(const std::string &content, int32_t lineOffset, const std::string &fileName) override
Definition LoggerSinkConfiguration.h:9
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9