kim-api 2.3.0+AppleClang.AppleClang.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Loading...
Searching...
No Matches
KIM_Log.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-2.3.0 package. */
28/* */
29
30
31#ifndef KIM_LOG_H_
32#define KIM_LOG_H_
33
34#ifndef KIM_FUNCTION_TYPES_H_
35#include "KIM_FunctionTypes.h" /* IWYU pragma: export */
36#endif
37
38/* Forward declarations */
39#ifndef KIM_LOG_VERBOSITY_DEFINED_
40#define KIM_LOG_VERBOSITY_DEFINED_
47#endif
48
49#ifndef KIM_LANGUAGE_NAME_DEFINED_
50#define KIM_LANGUAGE_NAME_DEFINED_
57#endif
58
59
60#ifndef KIM_LOG_DEFINED_
61#define KIM_LOG_DEFINED_
69typedef struct KIM_Log KIM_Log;
70#endif
71
79int KIM_Log_Create(KIM_Log ** const log);
80
88void KIM_Log_Destroy(KIM_Log ** const log);
89
99
109
119 KIM_Function * const fptr);
120
130
138char const * KIM_Log_GetID(KIM_Log const * const log);
139
147void KIM_Log_SetID(KIM_Log * const log, char const * const id);
148
157 KIM_LogVerbosity const logVerbosity);
158
167
175void KIM_Log_LogEntry(KIM_Log const * const log,
176 KIM_LogVerbosity const logVerbosity,
177 char const * const message,
178 int const lineNumber,
179 char const * const fileName);
180
181#endif /* KIM_LOG_H_ */
void() KIM_Function(void)
Generic function type.
int KIM_Log_Create(KIM_Log **const log)
Create a new KIM API Log object.
void KIM_Log_PopDefaultVerbosity()
Pop a LogVerbosity from the KIM API global default verbosity stack.
void KIM_Log_PopDefaultPrintFunction()
Pop a log PrintFunction from the KIM API global default log PrintFunction stack.
void KIM_Log_PopVerbosity(KIM_Log *const log)
Pop a LogVerbosity from the Log object's verbosity stack.
struct KIM_Log KIM_Log
Provides the logging interface for the KIM API.
Definition: KIM_Log.h:69
void KIM_Log_Destroy(KIM_Log **const log)
Destroy a previously Log::Create'd object.
void KIM_Log_PushVerbosity(KIM_Log *const log, KIM_LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the Log object's verbosity stack.
void KIM_Log_PushDefaultPrintFunction(KIM_LanguageName const languageName, KIM_Function *const fptr)
Push a new default log PrintFunction onto the KIM API global default log PrintFunction stack.
char const * KIM_Log_GetID(KIM_Log const *const log)
Get the identity of the Log object.
void KIM_Log_PushDefaultVerbosity(KIM_LogVerbosity const logVerbosity)
Push a new default LogVerbosity onto the KIM API global default verbosity stack.
void KIM_Log_LogEntry(KIM_Log const *const log, KIM_LogVerbosity const logVerbosity, char const *const message, int const lineNumber, char const *const fileName)
Write a log entry into the log file.
void KIM_Log_SetID(KIM_Log *const log, char const *const id)
Set the identity of the Log object.
An Extensible Enumeration for the LanguageName's supported by the KIM API.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.