proxygen
LogConfig.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <string>
19 #include <unordered_map>
20 
23 
24 namespace folly {
25 
33 class LogConfig {
34  public:
35  using CategoryConfigMap = std::unordered_map<std::string, LogCategoryConfig>;
36  using HandlerConfigMap = std::unordered_map<std::string, LogHandlerConfig>;
37 
38  LogConfig() = default;
39  explicit LogConfig(
40  HandlerConfigMap handlerConfigs,
41  CategoryConfigMap catConfigs)
42  : handlerConfigs_{std::move(handlerConfigs)},
43  categoryConfigs_{std::move(catConfigs)} {}
44 
46  return categoryConfigs_;
47  }
49  return handlerConfigs_;
50  }
51 
52  bool operator==(const LogConfig& other) const;
53  bool operator!=(const LogConfig& other) const;
54 
82  void update(const LogConfig& other);
83 
84  private:
87 };
88 
89 } // namespace folly
LogConfig()=default
bool operator!=(const LogConfig &other) const
Definition: LogConfig.cpp:27
const CategoryConfigMap & getCategoryConfigs() const
Definition: LogConfig.h:45
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
CategoryConfigMap categoryConfigs_
Definition: LogConfig.h:86
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
bool operator==(const LogConfig &other) const
Definition: LogConfig.cpp:22
std::unordered_map< std::string, LogCategoryConfig > CategoryConfigMap
Definition: LogConfig.h:35
std::unordered_map< std::string, LogHandlerConfig > HandlerConfigMap
Definition: LogConfig.h:36
const HandlerConfigMap & getHandlerConfigs() const
Definition: LogConfig.h:48
void update(const LogConfig &other)
Definition: LogConfig.cpp:31
HandlerConfigMap handlerConfigs_
Definition: LogConfig.h:85
LogConfig(HandlerConfigMap handlerConfigs, CategoryConfigMap catConfigs)
Definition: LogConfig.h:39