|
@@ -23,9 +23,9 @@ namespace logging {
|
|
|
properties _property(std::map<std::string, properties> const& m) {
|
|
properties _property(std::map<std::string, properties> const& m) {
|
|
|
return properties{properties::OBJECT, m, {}, {}};
|
|
return properties{properties::OBJECT, m, {}, {}};
|
|
|
}
|
|
}
|
|
|
- properties _list(std::vector<properties> const& l) {
|
|
|
|
|
- return properties{properties::ARRAY, {}, l, {}};
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// properties _list(std::vector<properties> const& l) {
|
|
|
|
|
+// return properties{properties::ARRAY, {}, l, {}};
|
|
|
|
|
+// }
|
|
|
properties _value(std::string const& s) {
|
|
properties _value(std::string const& s) {
|
|
|
return properties{properties::STRING, {}, {}, s};
|
|
return properties{properties::STRING, {}, {}, s};
|
|
|
}
|
|
}
|
|
@@ -43,43 +43,33 @@ namespace logging {
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- properties const STDOUT_DEFAULT_SCHEMA{
|
|
|
|
|
- _property({
|
|
|
|
|
- {"type", _value("Console")},
|
|
|
|
|
- {"name", _value("Console")},
|
|
|
|
|
- {"target", _value("SYSTEM_OUT")},
|
|
|
|
|
- {
|
|
|
|
|
- "data", _list({
|
|
|
|
|
- _property({
|
|
|
|
|
- {"type", _value("PatternLayout")},
|
|
|
|
|
- {"pattern", _value("%d{%h:%M:%s.%_ms} [%t] %-5.5p %.36c - %m%n")}
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ extern properties const DEFAULT_APPENDER_SCHEMA;
|
|
|
|
|
+ extern properties const DEFAULT_LOGGER_SCHEMA;
|
|
|
|
|
|
|
|
- properties const LOGGER_DEFAULT_SCHEMA {
|
|
|
|
|
- _property({
|
|
|
|
|
- {"type", _value("Root")},
|
|
|
|
|
- {"level", _value("Error")},
|
|
|
|
|
- {
|
|
|
|
|
- "data", _list({
|
|
|
|
|
- _property({
|
|
|
|
|
- {"type", _value("AppenderRef")},
|
|
|
|
|
- {"ref", _value("Console")}
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ static char const * const DEFAULT_PATTERN =
|
|
|
|
|
+ "%d{%h:%M:%s.%_ms} [%t] %-5.5p %.36c - %m%n";
|
|
|
|
|
+
|
|
|
|
|
+ properties const DEFAULT_APPENDER_SCHEMA{_property({
|
|
|
|
|
+ {"appenders", _property({
|
|
|
|
|
+ {"Console", _property({
|
|
|
|
|
+ {"target", _value("SYSTEM_OUT")},
|
|
|
|
|
+ {"PatternLayout", _property({
|
|
|
|
|
+ {"pattern", _value(DEFAULT_PATTERN)}
|
|
|
|
|
+ })}
|
|
|
|
|
+ })}
|
|
|
|
|
+ })}
|
|
|
|
|
+ })};
|
|
|
|
|
|
|
|
- properties const DEFAULT_SCHEMA{
|
|
|
|
|
- _property({
|
|
|
|
|
- {"Appenders",_list({STDOUT_DEFAULT_SCHEMA})},
|
|
|
|
|
- {"Loggers",_list({LOGGER_DEFAULT_SCHEMA})}
|
|
|
|
|
- })
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ properties const DEFAULT_LOGGER_SCHEMA{_property({
|
|
|
|
|
+ {"loggers", _property({
|
|
|
|
|
+ {"root", _property({
|
|
|
|
|
+ {"level", _value("Error")},
|
|
|
|
|
+ {"appenders", _property({
|
|
|
|
|
+ {"ref", _value("Console")}
|
|
|
|
|
+ })}
|
|
|
|
|
+ })}
|
|
|
|
|
+ })}
|
|
|
|
|
+ })};
|
|
|
|
|
|
|
|
properties::operator std::string const &() const {
|
|
properties::operator std::string const &() const {
|
|
|
expects(type == STRING, invalid_property_type, "expected STRING");
|
|
expects(type == STRING, invalid_property_type, "expected STRING");
|