Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCLogger.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
25#ifndef _WRAPS_C_TFCLOGGER_H_
26#define _WRAPS_C_TFCLOGGER_H_
27
28#include "tf_port_c.h"
29
30// Handles
31
32struct CAPI_EXPORT tfLogLevelHandle {
33 unsigned int LOG_CURRENT;
34 unsigned int LOG_FATAL;
35 unsigned int LOG_CRITICAL;
36 unsigned int LOG_ERROR;
37 unsigned int LOG_WARNING;
38 unsigned int LOG_NOTICE;
39 unsigned int LOG_INFORMATION;
40 unsigned int LOG_DEBUG;
41 unsigned int LOG_TRACE;
42};
43
44struct CAPI_EXPORT tfLogEventHandle {
45 unsigned int LOG_OUTPUTSTREAM_CHANGED;
46 unsigned int LOG_LEVEL_CHANGED;
47 unsigned int LOG_CALLBACK_SET;
48};
49
50
52// LogLevel //
54
55
62CAPI_FUNC(HRESULT) tfLogLevel_init(struct tfLogLevelHandle *handle);
63
64
66// LogEvent //
68
69
76CAPI_FUNC(HRESULT) tfLogEventHandle_init(struct tfLogEventHandle *handle);
77
78
80// Module functions //
82
83
90CAPI_FUNC(HRESULT) tfLogger_setLevel(unsigned int level);
91
98CAPI_FUNC(HRESULT) tfLogger_getLevel(unsigned int *level);
99
107CAPI_FUNC(HRESULT) tfLogger_enableFileLogging(const char *fileName, unsigned int level);
108
114CAPI_FUNC(HRESULT) tfLogger_disableFileLogging();
115
123CAPI_FUNC(HRESULT) tfLogger_getFileName(char **str, unsigned int *numChars);
124
132CAPI_FUNC(HRESULT) tfLogger_log(unsigned int level, const char *msg);
133
134#endif // _WRAPS_C_TFCLOGGER_H_
Definition tfCLogger.h:44
Definition tfCLogger.h:32
HRESULT tfLogger_log(unsigned int level, const char *msg)
logs a message to the log.
HRESULT tfLogger_enableFileLogging(const char *fileName, unsigned int level)
turns on file logging to the given file as the given level.
HRESULT tfLogger_getFileName(char **str, unsigned int *numChars)
Get the File Name objectget the name of the currently used log file.
HRESULT tfLogger_disableFileLogging()
turns off file logging, but has no effect on console logging.
HRESULT tfLogger_getLevel(unsigned int *level)
Get the Level objectget the current logging level.
HRESULT tfLogLevel_init(struct tfLogLevelHandle *handle)
Initialize an instance.
HRESULT tfLogger_setLevel(unsigned int level)
Set the Level objectsets the logging level to one a value from Logger::Level.
HRESULT tfLogEventHandle_init(struct tfLogEventHandle *handle)
Initialize an instance.