Kea
2.7.5
logger_level.cc
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
#include <config.h>
8
9
#include <
log/logger_level.h
>
10
#include <
log/macros.h
>
11
#include <
log/log_messages.h
>
12
13
#include <boost/algorithm/string.hpp>
14
15
16
namespace
isc
{
17
namespace
log {
18
19
isc::log::Severity
20
getSeverity
(
const
std::string& sev_str) {
21
if
(boost::iequals(sev_str,
"DEBUG"
)) {
22
return
isc::log::DEBUG
;
23
}
else
if
(boost::iequals(sev_str,
"INFO"
)) {
24
return
isc::log::INFO
;
25
}
else
if
(boost::iequals(sev_str,
"WARN"
)) {
26
return
isc::log::WARN
;
27
}
else
if
(boost::iequals(sev_str,
"ERROR"
)) {
28
return
isc::log::ERROR
;
29
}
else
if
(boost::iequals(sev_str,
"FATAL"
)) {
30
return
isc::log::FATAL
;
31
}
else
if
(boost::iequals(sev_str,
"NONE"
)) {
32
return
isc::log::NONE
;
33
}
else
{
34
Logger
logger(
"log"
);
35
LOG_ERROR
(logger,
LOG_BAD_SEVERITY
).arg(sev_str);
36
return
isc::log::INFO
;
37
}
38
}
39
40
41
}
// namespace log
42
}
// namespace isc
isc::log::Logger
Logger Class.
Definition
log/logger.h:142
log_messages.h
logger_level.h
macros.h
LOG_ERROR
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
Definition
macros.h:32
isc::log::LOG_BAD_SEVERITY
const isc::log::MessageID LOG_BAD_SEVERITY
Definition
log_messages.h:12
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::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::DEBUG
@ DEBUG
Definition
logger_level.h:25
isc
Defines the logger used by the top-level component of kea-lfc.
Definition
agent_parser.cc:148
src
lib
log
logger_level.cc
Generated on Fri Dec 6 2024 19:51:38 for Kea by
1.10.0