Golioth Firmware SDK
golioth_debug.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "golioth_config.h"
4 #include "golioth_time.h"
5 #include <stdbool.h>
6 
7 #ifndef __UNUSED
8 #if defined(__GNUC__) || defined(__clang__)
9 #define __UNUSED __attribute__((unused))
10 #else /* defined(__GNUC__) || defined(__clang__) */
11 #define __UNUSED
12 #endif /* defined(__GNUC__) || defined(__clang__) */
13 #endif /* __UNUSED */
14 
15 #ifndef LOG_TAG_DEFINE
16 #define LOG_TAG_DEFINE(tag) static __UNUSED const char* TAG = #tag
17 #endif
18 
19 typedef void* golioth_client_t;
20 
21 typedef enum {
29 
32 void golioth_debug_hexdump(const char* tag, const void* addr, int len);
36  uint64_t tstamp_ms,
38  const char* tag,
39  const char* format,
40  ...);
golioth_debug_log_level_t
Definition: golioth_debug.h:21
@ GOLIOTH_DEBUG_LOG_LEVEL_NONE
Definition: golioth_debug.h:22
@ GOLIOTH_DEBUG_LOG_LEVEL_ERROR
Definition: golioth_debug.h:23
@ GOLIOTH_DEBUG_LOG_LEVEL_VERBOSE
Definition: golioth_debug.h:27
@ GOLIOTH_DEBUG_LOG_LEVEL_WARN
Definition: golioth_debug.h:24
@ GOLIOTH_DEBUG_LOG_LEVEL_INFO
Definition: golioth_debug.h:25
@ GOLIOTH_DEBUG_LOG_LEVEL_DEBUG
Definition: golioth_debug.h:26
void golioth_debug_set_client(golioth_client_t client)
void golioth_debug_set_cloud_log_enabled(bool enable)
void golioth_debug_printf(uint64_t tstamp_ms, golioth_debug_log_level_t level, const char *tag, const char *format,...)
golioth_debug_log_level_t golioth_debug_get_log_level(void)
void golioth_debug_set_log_level(golioth_debug_log_level_t level)
void * golioth_client_t
Definition: golioth_debug.h:19
void golioth_debug_hexdump(const char *tag, const void *addr, int len)
void * golioth_client_t
Opaque handle to the Golioth client.