Kea  1.5.0
logging_info.h
Go to the documentation of this file.
1 // Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef DHCPSRV_LOGGING_INFO_H
8 #define DHCPSRV_LOGGING_INFO_H
9 
10 #include <log/logger_level.h>
12 #include <cc/cfg_to_element.h>
13 #include <cc/user_context.h>
14 #include <stdint.h>
15 #include <vector>
16 
17 namespace isc {
18 namespace process {
19 
24 public:
25 
30  std::string output_;
31 
33  int maxver_;
34 
36  uint64_t maxsize_;
37 
39  bool flush_;
40 
46  bool equals(const LoggingDestination& other) const;
47 
50  : output_("stdout"), maxver_(1), maxsize_(10240000), flush_(true) {
51  }
52 
56  virtual isc::data::ElementPtr toElement() const;
57 };
58 
77 public:
78 
80  std::string name_;
81 
84 
89 
91  std::vector<LoggingDestination> destinations_;
92 
94  LoggingInfo();
95 
98  destinations_.clear();
99  }
100 
106  bool equals(const LoggingInfo& other) const;
107 
113  bool operator==(const LoggingInfo& other) const {
114  return (equals(other));
115  }
116 
122  bool operator!=(const LoggingInfo& other) const {
123  return (!equals(other));
124  }
125 
128 
132  virtual isc::data::ElementPtr toElement() const;
133 };
134 
136 typedef std::vector<isc::process::LoggingInfo> LoggingInfoStorage;
137 
138 }
139 }
140 
141 #endif // DHCPSRV_LOGGING_INFO_H
isc::process::LoggingDestination::output_
std::string output_
defines logging destination output
Definition: logging_info.h:30
isc::process::LoggingDestination
Defines single logging destination.
Definition: logging_info.h:23
user_context.h
isc::process::LoggingInfo::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: logging_info.cc:160
logger_level.h
isc::process::LoggingInfo::destinations_
std::vector< LoggingDestination > destinations_
specific logging destinations
Definition: logging_info.h:91
isc::process::LoggingInfo::toSpec
isc::log::LoggerSpecification toSpec() const
Converts logger configuration to a spec.
Definition: logging_info.cc:101
isc::log::LoggerSpecification
Definition: logger_specification.h:29
isc::process::LoggingInfo::operator!=
bool operator!=(const LoggingInfo &other) const
Compares two objects for inequality.
Definition: logging_info.h:122
isc::log::Severity
Severity
Severity Levels.
Definition: logger_level.h:23
isc::data::CfgToElement
Abstract class for configuration Cfg_* classes.
Definition: cfg_to_element.h:29
isc::data::UserContext
Base class for user context.
Definition: user_context.h:22
isc::process::LoggingInfo::LoggingInfo
LoggingInfo()
Default constructor.
Definition: logging_info.cc:42
isc::process::LoggingInfo
structure that describes one logging entry
Definition: logging_info.h:76
isc::process::LoggingDestination::maxsize_
uint64_t maxsize_
Maximum log file size.
Definition: logging_info.h:36
isc::process::LoggingDestination::flush_
bool flush_
Immediate flush.
Definition: logging_info.h:39
isc::process::LoggingInfo::name_
std::string name_
logging name
Definition: logging_info.h:80
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
logger_specification.h
isc::process::LoggingDestination::LoggingDestination
LoggingDestination()
Default constructor.
Definition: logging_info.h:49
cfg_to_element.h
isc::process::LoggingDestination::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: logging_info.cc:27
isc::process::LoggingInfoStorage
std::vector< isc::process::LoggingInfo > LoggingInfoStorage
storage for logging information in log4cplus format
Definition: logging_info.h:136
isc::process::LoggingInfo::operator==
bool operator==(const LoggingInfo &other) const
Compares two objects for equality.
Definition: logging_info.h:113
isc::process::LoggingInfo::equals
bool equals(const LoggingInfo &other) const
Compares two objects for equality.
Definition: logging_info.cc:66
isc::process::LoggingDestination::equals
bool equals(const LoggingDestination &other) const
Compares two objects for equality.
Definition: logging_info.cc:19
isc::process::LoggingInfo::clearDestinations
void clearDestinations()
Removes logging destinations.
Definition: logging_info.h:97
isc::process::LoggingInfo::debuglevel_
int debuglevel_
debuglevel (used when severity_ == DEBUG)
Definition: logging_info.h:88
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::process::LoggingDestination::maxver_
int maxver_
Maximum number of log files in rotation.
Definition: logging_info.h:33
isc::process::LoggingInfo::severity_
isc::log::Severity severity_
describes logging severity
Definition: logging_info.h:83