kdriveExpress SDK 22.1.1
kdrive_express_logger.h
Go to the documentation of this file.
1//
2// Copyright (c) 2002-2022 WEINZIERL ENGINEERING GmbH
3// All rights reserved.
4//
5// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
8// SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY,
9// WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
10// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
11//
12
13#ifndef __KDRIVE_EXPRESS_LOGGER_H__
14#define __KDRIVE_EXPRESS_LOGGER_H__
15
17
25#define KDRIVE_LOGGER_NONE (0)
26#define KDRIVE_LOGGER_FATAL (1)
27#define KDRIVE_LOGGER_CRITICAL (2)
28#define KDRIVE_LOGGER_ERROR (3)
29#define KDRIVE_LOGGER_WARNING (4)
30#define KDRIVE_LOGGER_NOTICE (5)
31#define KDRIVE_LOGGER_INFORMATION (6)
32#define KDRIVE_LOGGER_DEBUG (7)
33#define KDRIVE_LOGGER_TRACE (8)
35#ifdef __cplusplus
36extern "C" {
37#endif
38
59
65
73
79kdriveExpress_API void kdrive_logger_file_ex(const char* filename);
80
87kdriveExpress_API void kdrive_logger_syslog(const char* address, const char* name);
88
95typedef void(*kdrive_logger_callback)(uint8_t level, const char* message);
96
103
110kdriveExpress_API void kdrive_logger(uint8_t level, const char* message);
111
118kdriveExpress_API void kdrive_logger_ex(uint8_t level, const char* fmt, ...);
119
133kdriveExpress_API void kdrive_logger_dump(uint8_t level, const char* message, const void* buffer, uint32_t buffer_len);
134
135#ifdef __cplusplus
136}
137#endif
138
139#endif /* __KDRIVE_EXPRESS_LOGGER_H__ */
kdriveExpress_API void kdrive_logger(uint8_t level, const char *message)
Writes to the kdrive express logger.
kdriveExpress_API void kdrive_logger_dump(uint8_t level, const char *message, const void *buffer, uint32_t buffer_len)
Logs the given message, followed by the data in buffer.
kdriveExpress_API void kdrive_logger_console(void)
Sets the logger to write to the console.
kdriveExpress_API void kdrive_logger_set_callback(kdrive_logger_callback c)
Set the logger to call a user callback function.
kdriveExpress_API void kdrive_logger_file_ex(const char *filename)
Set the logger to write to a specified file.
kdriveExpress_API void kdrive_logger_ex(uint8_t level, const char *fmt,...)
Writes to the kdrive express logger.
kdriveExpress_API void kdrive_logger_syslog(const char *address, const char *name)
Set the logger to write to a remote host with the syslog protocol.
kdriveExpress_API void kdrive_logger_file(void)
Set the logger to write to a file The file is written to the current path as logfile_pid where pid is...
kdriveExpress_API void kdrive_logger_set_level(uint8_t level)
Sets the root logger level This is once of:
#define kdriveExpress_API
Definition: kdrive_express_config.h:88
unsigned int uint32_t
32 bit unsigned char
Definition: kdrive_express_config.h:31
unsigned char uint8_t
8 bit unsigned char
Definition: kdrive_express_config.h:29
void(* kdrive_logger_callback)(uint8_t level, const char *message)
Logger Callback function type (pointer to function definition)
Definition: kdrive_express_logger.h:95