Kea  2.3.3-git
logger_level.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2015 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 LOGGER_LEVEL_H
8 #define LOGGER_LEVEL_H
9 
10 #include <string>
11 
12 namespace isc {
13 namespace log {
14 
22 
23 typedef enum {
24  DEFAULT = 0, // Default to logging level of the parent
25  DEBUG = 1,
26  INFO = 2,
27  WARN = 3,
28  ERROR = 4,
29  FATAL = 5,
30  NONE = 6 // Disable logging
31 } Severity;
32 
34 
35 const int MIN_DEBUG_LEVEL = 0;
36 const int MAX_DEBUG_LEVEL = 99;
37 
42 struct Level {
44  int dbglevel;
45 
46  Level(Severity sev = DEFAULT, int dbg = MIN_DEBUG_LEVEL) :
47  severity(sev), dbglevel(dbg)
48  {}
49 
50  // Default assignment and copy constructor is appropriate
51 };
52 
63 isc::log::Severity getSeverity(const std::string& sev_str);
64 
65 } // namespace log
66 } // namespace isc
67 
68 #endif // LOGGER_LEVEL_H
isc::log::Severity getSeverity(const std::string &sev_str)
Returns the isc::log::Severity value represented by the given string.
Definition: logger_level.cc:20
Severity severity
Logging severity.
Definition: logger_level.h:43
const int MIN_DEBUG_LEVEL
Minimum/maximum debug levels.
Definition: logger_level.h:35
int dbglevel
Debug level.
Definition: logger_level.h:44
Severity
Severity Levels.
Definition: logger_level.h:23
Defines the logger used by the top-level component of kea-lfc.
Log level structure.
Definition: logger_level.h:42
Level(Severity sev=DEFAULT, int dbg=MIN_DEBUG_LEVEL)
Definition: logger_level.h:46
const int MAX_DEBUG_LEVEL
Definition: logger_level.h:36