kim-api  2.3.0+v2.3.0.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_LogMacros.hpp
Go to the documentation of this file.
1 //
2 // KIM-API: An API for interatomic models
3 // Copyright (c) 2013--2022, Regents of the University of Minnesota.
4 // All rights reserved.
5 //
6 // Contributors:
7 // Ryan S. Elliott
8 //
9 // SPDX-License-Identifier: LGPL-2.1-or-later
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation; either
14 // version 2.1 of the License, or (at your option) any later version.
15 //
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public License
22 // along with this library; if not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 //
25 
26 //
27 // Release: This file is part of the kim-api-2.3.0 package.
28 //
29 
30 
31 #undef FATAL_VERBOSITY
32 #define FATAL_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_FATAL_)
34 #undef LOG_FATAL
35 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_FATAL_)
36 #define LOG_FATAL(message) \
40  KIM_LOGGER_OBJECT_NAME->LogEntry( \
41  KIM::LOG_VERBOSITY::fatal, message, __LINE__, __FILE__)
42 #else
43 #define LOG_FATAL(message)
44 #endif
45 
46 #undef ERROR_VERBOSITY
47 #define ERROR_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_ERROR_)
49 #undef LOG_ERROR
50 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_ERROR_)
51 #define LOG_ERROR(message) \
55  KIM_LOGGER_OBJECT_NAME->LogEntry( \
56  KIM::LOG_VERBOSITY::error, message, __LINE__, __FILE__)
57 #else
58 #define LOG_ERROR(message)
59 #endif
60 
61 #undef WARNING_VERBOSITY
62 #define WARNING_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_WARNING_)
64 #undef LOG_WARNING
65 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_WARNING_)
66 #define LOG_WARNING(message) \
70  KIM_LOGGER_OBJECT_NAME->LogEntry( \
71  KIM::LOG_VERBOSITY::warning, message, __LINE__, __FILE__)
72 #else
73 #define LOG_WARNING(message)
74 #endif
75 
76 #undef INFORMATION_VERBOSITY
77 #define INFORMATION_VERBOSITY \
79  (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_INFORMATION_)
80 #undef LOG_INFORMATION
81 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_INFORMATION_)
82 #define LOG_INFORMATION(message) \
86  KIM_LOGGER_OBJECT_NAME->LogEntry( \
87  KIM::LOG_VERBOSITY::information, message, __LINE__, __FILE__)
88 #else
89 #define LOG_INFORMATION(message)
90 #endif
91 
92 #undef DEBUG_VERBOSITY
93 #define DEBUG_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_DEBUG_)
95 #undef LOG_DEBUG
96 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_DEBUG_)
97 #define LOG_DEBUG(message) \
101  KIM_LOGGER_OBJECT_NAME->LogEntry( \
102  KIM::LOG_VERBOSITY::debug, message, __LINE__, __FILE__)
103 #else
104 #define LOG_DEBUG(message)
105 #endif