kdriveExpress SDK 22.1.1
kdrive_express_logger.h File Reference

kdriveExpress Logger API More...

Go to the source code of this file.

Macros

#define KDRIVE_LOGGER_NONE   (0)
 No logger. More...
 
#define KDRIVE_LOGGER_FATAL   (1)
 A fatal error. More...
 
#define KDRIVE_LOGGER_CRITICAL   (2)
 A critical error. More...
 
#define KDRIVE_LOGGER_ERROR   (3)
 An error. More...
 
#define KDRIVE_LOGGER_WARNING   (4)
 A warning. More...
 
#define KDRIVE_LOGGER_NOTICE   (5)
 A notice, which is an information with just a higher priority. More...
 
#define KDRIVE_LOGGER_INFORMATION   (6)
 An informational message, usually denoting the successful completion of an operation. More...
 
#define KDRIVE_LOGGER_DEBUG   (7)
 A debugging message. More...
 
#define KDRIVE_LOGGER_TRACE   (8)
 A tracing message. More...
 

Typedefs

typedef void(* kdrive_logger_callback) (uint8_t level, const char *message)
 Logger Callback function type (pointer to function definition) More...
 

Functions

kdriveExpress_API void kdrive_logger_set_level (uint8_t level)
 Sets the root logger level This is once of: More...
 
kdriveExpress_API void kdrive_logger_console (void)
 Sets the logger to write to the console. More...
 
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 the process id. More...
 
kdriveExpress_API void kdrive_logger_file_ex (const char *filename)
 Set the logger to write to a specified file. More...
 
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. More...
 
kdriveExpress_API void kdrive_logger_set_callback (kdrive_logger_callback c)
 Set the logger to call a user callback function. More...
 
kdriveExpress_API void kdrive_logger (uint8_t level, const char *message)
 Writes to the kdrive express logger. More...
 
kdriveExpress_API void kdrive_logger_ex (uint8_t level, const char *fmt,...)
 Writes to the kdrive express logger. More...
 
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. More...
 

Detailed Description

kdriveExpress Logger API

Author
Copyright (c) 2002-2022 WEINZIERL ENGINEERING GmbH

Macro Definition Documentation

◆ KDRIVE_LOGGER_CRITICAL

#define KDRIVE_LOGGER_CRITICAL   (2)

A critical error.

The application might not be able to continue running successfully.

◆ KDRIVE_LOGGER_DEBUG

#define KDRIVE_LOGGER_DEBUG   (7)

A debugging message.

◆ KDRIVE_LOGGER_ERROR

#define KDRIVE_LOGGER_ERROR   (3)

◆ KDRIVE_LOGGER_FATAL

#define KDRIVE_LOGGER_FATAL   (1)

A fatal error.

The application will most likely terminate. This is the highest priority.

Examples
kdrive_express_dpt.c, kdrive_express_ip_routing.c, kdrive_express_ip_routing_enumerate.c, kdrive_express_services.c, and kdrive_express_usb.c.

◆ KDRIVE_LOGGER_INFORMATION

#define KDRIVE_LOGGER_INFORMATION   (6)

◆ KDRIVE_LOGGER_NONE

#define KDRIVE_LOGGER_NONE   (0)

No logger.

◆ KDRIVE_LOGGER_NOTICE

#define KDRIVE_LOGGER_NOTICE   (5)

A notice, which is an information with just a higher priority.

◆ KDRIVE_LOGGER_TRACE

#define KDRIVE_LOGGER_TRACE   (8)

A tracing message.

This is the lowest priority.

◆ KDRIVE_LOGGER_WARNING

#define KDRIVE_LOGGER_WARNING   (4)

A warning.

An operation completed with an unexpected result.

Typedef Documentation

◆ kdrive_logger_callback

typedef void(* kdrive_logger_callback) (uint8_t level, const char *message)

Logger Callback function type (pointer to function definition)

See also
kdrive_logger_callback
Parameters
[in]levelthe logger level (priority)
[in]messagethe log message