Kea  1.9.9-git
output_option.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2019 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 OUTPUT_OPTION_H
8 #define OUTPUT_OPTION_H
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 #include <string>
13 
33 
34 namespace isc {
35 namespace log {
36 
37 struct OutputOption {
38 
40  static const std::string DEFAULT_CONSOLE_PATTERN;
42  static const std::string DEFAULT_FILE_PATTERN;
44  static const std::string DEFAULT_SYSLOG_PATTERN;
45 
48  typedef enum {
50  DEST_FILE = 1,
52  } Destination;
53 
55  typedef enum {
58  } Stream;
59 
62  flush(true), facility("LOCAL0"), filename(""),
63  maxsize(0), maxver(0), pattern("")
64  {}
65 
67 
70  bool flush;
71  std::string facility;
72  std::string filename;
73  size_t maxsize;
74  unsigned int maxver;
75  std::string pattern;
76 };
77 
78 OutputOption::Destination getDestination(const std::string& dest_str);
79 OutputOption::Stream getStream(const std::string& stream_str);
80 
81 
82 } // namespace log
83 } // namespace isc
84 
85 #endif // OUTPUT_OPTION_H
size_t maxsize
0 if no maximum size
Definition: output_option.h:73
OutputOption::Stream getStream(const std::string &stream_str)
bool flush
true to flush after each message
Definition: output_option.h:70
Stream stream
stdout/stderr if console output
Definition: output_option.h:69
static const std::string DEFAULT_SYSLOG_PATTERN
Default layout pattern for syslog logs.
Definition: output_option.h:44
std::string facility
syslog facility
Definition: output_option.h:71
Destination
Destinations.
Definition: output_option.h:48
std::string pattern
log content pattern
Definition: output_option.h:75
Destination destination
Members.
Definition: output_option.h:68
static const std::string DEFAULT_CONSOLE_PATTERN
Default layout pattern for console logs.
Definition: output_option.h:40
Defines the logger used by the top-level component of kea-dhcp-ddns.
OutputOption::Destination getDestination(const std::string &dest_str)
unsigned int maxver
Maximum versions (none if <= 0)
Definition: output_option.h:74
OutputOption()
Constructor.
Definition: output_option.h:61
static const std::string DEFAULT_FILE_PATTERN
Default layout pattern for file logs.
Definition: output_option.h:42
Stream
If console, stream on which messages are output.
Definition: output_option.h:55
std::string filename
Filename if file output.
Definition: output_option.h:72