kim-api  2.3.1-git+v2.3.0-git-2-g378406f9.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_LogMacros.h
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.git repository. */
28 /* */
29 
30 
31 #undef FATAL_VERBOSITY
32 
35 #define FATAL_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_FATAL_)
36 #undef LOG_FATAL
37 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_FATAL_)
38 
43 #define LOG_FATAL(message) \
44  KIM_LOGGER_FUNCTION_NAME(KIM_LOGGER_OBJECT_NAME, \
45  KIM_LOG_VERBOSITY_fatal, \
46  message, \
47  __LINE__, \
48  __FILE__)
49 #else
50 #define LOG_FATAL(message)
51 #endif
52 
53 #undef ERROR_VERBOSITY
54 
57 #define ERROR_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_ERROR_)
58 #undef LOG_ERROR
59 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_ERROR_)
60 
65 #define LOG_ERROR(message) \
66  KIM_LOGGER_FUNCTION_NAME(KIM_LOGGER_OBJECT_NAME, \
67  KIM_LOG_VERBOSITY_error, \
68  message, \
69  __LINE__, \
70  __FILE__)
71 #else
72 #define LOG_ERROR(message)
73 #endif
74 
75 #undef WARNING_VERBOSITY
76 
79 #define WARNING_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_WARNING_)
80 #undef LOG_WARNING
81 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_WARNING_)
82 
87 #define LOG_WARNING(message) \
88  KIM_LOGGER_FUNCTION_NAME(KIM_LOGGER_OBJECT_NAME, \
89  KIM_LOG_VERBOSITY_warning, \
90  message, \
91  __LINE__, \
92  __FILE__)
93 #else
94 #define LOG_WARNING(message)
95 #endif
96 
97 #undef INFORMATION_VERBOSITY
98 
101 #define INFORMATION_VERBOSITY \
102  (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_INFORMATION_)
103 #undef LOG_INFORMATION
104 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_INFORMATION_)
105 
110 #define LOG_INFORMATION(message) \
111  KIM_LOGGER_FUNCTION_NAME(KIM_LOGGER_OBJECT_NAME, \
112  KIM_LOG_VERBOSITY_information, \
113  message, \
114  __LINE__, \
115  __FILE__)
116 #else
117 #define LOG_INFORMATION(message)
118 #endif
119 
120 #undef DEBUG_VERBOSITY
121 
124 #define DEBUG_VERBOSITY (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_DEBUG_)
125 #undef LOG_DEBUG
126 #if (KIM_LOG_MAXIMUM_LEVEL >= KIM_LOG_VERBOSITY_DEBUG_)
127 
132 #define LOG_DEBUG(message) \
133  KIM_LOGGER_FUNCTION_NAME(KIM_LOGGER_OBJECT_NAME, \
134  KIM_LOG_VERBOSITY_debug, \
135  message, \
136  __LINE__, \
137  __FILE__)
138 #else
139 #define LOG_DEBUG(message)
140 #endif