Golioth Firmware SDK
Loading...
Searching...
No Matches
golioth_log

Functions

enum golioth_status golioth_log_error_async (struct golioth_client *client, const char *tag, const char *log_message, golioth_set_cb_fn callback, void *callback_arg)
 
enum golioth_status golioth_log_warn_async (struct golioth_client *client, const char *tag, const char *log_message, golioth_set_cb_fn callback, void *callback_arg)
 Same as golioth_log_error_async, but for warning level.
 
enum golioth_status golioth_log_info_async (struct golioth_client *client, const char *tag, const char *log_message, golioth_set_cb_fn callback, void *callback_arg)
 Same as golioth_log_error_async, but for info level.
 
enum golioth_status golioth_log_debug_async (struct golioth_client *client, const char *tag, const char *log_message, golioth_set_cb_fn callback, void *callback_arg)
 Same as golioth_log_error_async, but for debug level.
 
enum golioth_status golioth_log_error_sync (struct golioth_client *client, const char *tag, const char *log_message, int32_t timeout_s)
 
enum golioth_status golioth_log_warn_sync (struct golioth_client *client, const char *tag, const char *log_message, int32_t timeout_s)
 Same as golioth_log_error_sync, but for warning level.
 
enum golioth_status golioth_log_info_sync (struct golioth_client *client, const char *tag, const char *log_message, int32_t timeout_s)
 Same as golioth_log_error_sync, but for info level.
 
enum golioth_status golioth_log_debug_sync (struct golioth_client *client, const char *tag, const char *log_message, int32_t timeout_s)
 Same as golioth_log_error_sync, but for debug level.
 

Detailed Description

Functions for logging messages to Golioth

https://docs.golioth.io/reference/protocols/coap/logging

Function Documentation

◆ golioth_log_debug_async()

enum golioth_status golioth_log_debug_async ( struct golioth_client * client,
const char * tag,
const char * log_message,
golioth_set_cb_fn callback,
void * callback_arg )

Same as golioth_log_error_async, but for debug level.

◆ golioth_log_debug_sync()

enum golioth_status golioth_log_debug_sync ( struct golioth_client * client,
const char * tag,
const char * log_message,
int32_t timeout_s )

Same as golioth_log_error_sync, but for debug level.

◆ golioth_log_error_async()

enum golioth_status golioth_log_error_async ( struct golioth_client * client,
const char * tag,
const char * log_message,
golioth_set_cb_fn callback,
void * callback_arg )

Log an error to Golioth asynchronously

This function will enqueue a request and return immediately without waiting for a response from the server. The callback will be invoked when a response is received or a timeout occurs.

Parameters
clientThe client handle from golioth_client_create
tagA free-form string to identify/tag the message
log_messageString to log. Must be NULL-terminated.
callbackCallback to call on response received or timeout. Can be NULL.
callback_argCallback argument, passed directly when callback invoked. Can be NULL.

◆ golioth_log_error_sync()

enum golioth_status golioth_log_error_sync ( struct golioth_client * client,
const char * tag,
const char * log_message,
int32_t timeout_s )

Log an error to Golioth synchronously

This function will block until one of three things happen (whichever comes first):

  1. A response is received from the server
  2. The user-provided timeout_s period expires without receiving a response
  3. The default GOLIOTH_COAP_RESPONSE_TIMEOUT_S period expires without receiving a response
Parameters
clientThe client handle from golioth_client_create
tagA free-form string to identify/tag the message
log_messageString to log. Must be NULL-terminated.
timeout_sThe timeout, in seconds, for receiving a server response

◆ golioth_log_info_async()

enum golioth_status golioth_log_info_async ( struct golioth_client * client,
const char * tag,
const char * log_message,
golioth_set_cb_fn callback,
void * callback_arg )

Same as golioth_log_error_async, but for info level.

◆ golioth_log_info_sync()

enum golioth_status golioth_log_info_sync ( struct golioth_client * client,
const char * tag,
const char * log_message,
int32_t timeout_s )

Same as golioth_log_error_sync, but for info level.

◆ golioth_log_warn_async()

enum golioth_status golioth_log_warn_async ( struct golioth_client * client,
const char * tag,
const char * log_message,
golioth_set_cb_fn callback,
void * callback_arg )

Same as golioth_log_error_async, but for warning level.

◆ golioth_log_warn_sync()

enum golioth_status golioth_log_warn_sync ( struct golioth_client * client,
const char * tag,
const char * log_message,
int32_t timeout_s )

Same as golioth_log_error_sync, but for warning level.