Kea: logger_level.h Source File

| Kea 2.2.0

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
12namespace isc {
13namespace 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 {
43 Severity severity;
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::getSeverity
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
isc::log::MAX_DEBUG_LEVEL
const int MAX_DEBUG_LEVEL
Definition: logger_level.h:36
isc::log::MIN_DEBUG_LEVEL
const int MIN_DEBUG_LEVEL
Minimum/maximum debug levels.
Definition: logger_level.h:35
isc::log::Severity
Severity
Severity Levels.
Definition: logger_level.h:23
isc::log::WARN
@ WARN
Definition: logger_level.h:27
isc::log::NONE
@ NONE
Definition: logger_level.h:30
isc::log::ERROR
@ ERROR
Definition: logger_level.h:28
isc::log::INFO
@ INFO
Definition: logger_level.h:26
isc::log::FATAL
@ FATAL
Definition: logger_level.h:29
isc::log::DEFAULT
@ DEFAULT
Definition: logger_level.h:24
isc::log::DEBUG
@ DEBUG
Definition: logger_level.h:25
isc
Defines the logger used by the top-level component of kea-lfc.
Definition: agent_parser.cc:143
isc::log::Level
Log level structure.
Definition: logger_level.h:42
isc::log::Level::dbglevel
int dbglevel
Debug level.
Definition: logger_level.h:44
isc::log::Level::Level
Level(Severity sev=DEFAULT, int dbg=MIN_DEBUG_LEVEL)
Definition: logger_level.h:46
isc::log::Level::severity
Severity severity
Logging severity.
Definition: logger_level.h:43