Kea 2.5.8
macros.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 LOG_MACROS_H
8#define LOG_MACROS_H
9
10#include <log/logger.h>
11#include <log/log_dbglevels.h>
12
14#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE) \
15 if (!(LOGGER).isDebugEnabled((LEVEL))) { \
16 } else \
17 (LOGGER).debug((LEVEL), (MESSAGE))
18
20#define LOG_INFO(LOGGER, MESSAGE) \
21 if (!(LOGGER).isInfoEnabled()) { \
22 } else \
23 (LOGGER).info((MESSAGE))
24
26#define LOG_WARN(LOGGER, MESSAGE) \
27 if (!(LOGGER).isWarnEnabled()) { \
28 } else \
29 (LOGGER).warn((MESSAGE))
30
32#define LOG_ERROR(LOGGER, MESSAGE) \
33 if (!(LOGGER).isErrorEnabled()) { \
34 } else \
35 (LOGGER).error((MESSAGE))
36
38#define LOG_FATAL(LOGGER, MESSAGE) \
39 if (!(LOGGER).isFatalEnabled()) { \
40 } else \
41 (LOGGER).fatal((MESSAGE))
42
43#endif
When a message is logged with DEBUG severity, the debug level associated with the message is also spe...