1 /** @file
2 
3   @section license License
4 
5   Licensed to the Apache Software Foundation (ASF) under one
6   or more contributor license agreements.  See the NOTICE file
7   distributed with this work for additional information
8   regarding copyright ownership.  The ASF licenses this file
9   to you under the Apache License, Version 2.0 (the
10   "License"); you may not use this file except in compliance
11   with the License.  You may obtain a copy of the License at
12 
13       http://www.apache.org/licenses/LICENSE-2.0
14 
15   Unless required by applicable law or agreed to in writing, software
16   distributed under the License is distributed on an "AS IS" BASIS,
17   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   See the License for the specific language governing permissions and
19   limitations under the License.
20  */
21 
22 #pragma once
23 
24 class LogConfig;
25 class LogObject;
26 namespace YAML
27 {
28 class Node;
29 };
30 
31 class YamlLogConfig
32 {
33 public:
YamlLogConfig(LogConfig * logConfig)34   YamlLogConfig(LogConfig *logConfig) : cfg(logConfig){};
35   bool parse(const char *cfgFilename);
36 
37 private:
38   bool loadLogConfig(const char *cfgFilename);
39 
40   LogObject *decodeLogObject(const YAML::Node &node);
41 
42   YamlLogConfig(const YamlLogConfig &) = delete;
43   YamlLogConfig &operator=(const YamlLogConfig &) = delete;
44 
45   LogConfig *cfg;
46 };
47