kdriveExpress SDK 23.2.0
kdriveExpress Logger API

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

Function Documentation

◆ kdrive_logger()

kdriveExpress_API void kdrive_logger ( uint8_t  level,
const char *  message 
)

◆ kdrive_logger_console()

◆ kdrive_logger_dump()

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.

The data in buffer is written in canonical hex+ASCII form: Offset (4 bytes) in hexadecimal, followed by sixteen space-separated, two column, hexadecimal bytes, followed by the same sixteen bytes as ASCII characters. For bytes outside the range 32 .. 127, a dot is printed.

Parameters
[in]levelthe logger level
[in]messagethe log message
[in]bufferthe data array
[in]buffer_lenthe buffer length
Examples
kdrive_express_data_secure.c, kdrive_express_dpt.c, kdrive_express_ip_tunneling.c, and kdrive_express_usb.c.

◆ kdrive_logger_ex()

kdriveExpress_API void kdrive_logger_ex ( uint8_t  level,
const char *  fmt,
  ... 
)

◆ kdrive_logger_file()

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.

◆ kdrive_logger_file_ex()

kdriveExpress_API void kdrive_logger_file_ex ( const char *  filename)

Set the logger to write to a specified file.

Parameters
[in]filenamethe logger filename

◆ kdrive_logger_set_callback()

kdriveExpress_API void kdrive_logger_set_callback ( kdrive_logger_callback  c)

Set the logger to call a user callback function.

Parameters
[in]cthe logger callback pointer to function

◆ kdrive_logger_set_level()

kdriveExpress_API void kdrive_logger_set_level ( uint8_t  level)

Sets the root logger level This is once of:

  • KDRIVE_LOGGER_NONE (turns off logging)
  • KDRIVE_LOGGER_FATAL
  • KDRIVE_LOGGER_CRITICAL
  • KDRIVE_LOGGER_ERROR
  • KDRIVE_LOGGER_WARNING
  • KDRIVE_LOGGER_NOTICE
  • KDRIVE_LOGGER_INFORMATION
  • KDRIVE_LOGGER_DEBUG
  • KDRIVE_LOGGER_TRACE Sets the level of the root logger. All loggers that are added to this logger inherit this value. This should be called before creating the logger i.e. via kdrive_logger_console etc
    Parameters
    [in]levelthe logger level
Examples
kdrive_express_data_secure.c, kdrive_express_dpt.c, kdrive_express_ip_tunneling.c, kdrive_express_ip_tunneling_enumerate.c, kdrive_express_ip_tunneling_keyring.c, kdrive_express_ip_tunneling_secure.c, kdrive_express_tunnel_ind_addr.c, and kdrive_express_usb.c.

◆ kdrive_logger_syslog()

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.

Parameters
[in]addressthe remote host either as IP or IP:PORT
[in]namethe target name