Golioth Firmware SDK
Loading...
Searching...
No Matches
golioth_debug.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Golioth, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifdef __cplusplus
8extern "C"
9{
10#endif
11
12#pragma once
13
14#include <golioth/config.h>
15#include <stdbool.h>
16#include <stdint.h>
17
18#ifndef __UNUSED
19#if defined(__GNUC__) || defined(__clang__)
20#define __UNUSED __attribute__((unused))
21#else /* defined(__GNUC__) || defined(__clang__) */
22#define __UNUSED
23#endif /* defined(__GNUC__) || defined(__clang__) */
24#endif /* __UNUSED */
25
26#ifndef LOG_TAG_DEFINE
27#define LOG_TAG_DEFINE(tag) static __UNUSED const char *TAG = #tag
28#endif
29
30struct golioth_client;
31
41
44void golioth_debug_hexdump(const char *tag, const void *addr, int len);
45void golioth_debug_set_client(struct golioth_client *client);
47void golioth_debug_printf(uint64_t tstamp_ms,
48 enum golioth_debug_log_level level,
49 const char *tag,
50 const char *format,
51 ...);
52
53#ifdef __cplusplus
54}
55#endif
enum golioth_debug_log_level golioth_debug_get_log_level(void)
void golioth_debug_set_cloud_log_enabled(bool enable)
void golioth_debug_set_client(struct golioth_client *client)
void golioth_debug_set_log_level(enum golioth_debug_log_level level)
void golioth_debug_printf(uint64_t tstamp_ms, enum golioth_debug_log_level level, const char *tag, const char *format,...)
golioth_debug_log_level
@ GOLIOTH_DEBUG_LOG_LEVEL_NONE
@ GOLIOTH_DEBUG_LOG_LEVEL_ERROR
@ GOLIOTH_DEBUG_LOG_LEVEL_VERBOSE
@ GOLIOTH_DEBUG_LOG_LEVEL_WARN
@ GOLIOTH_DEBUG_LOG_LEVEL_INFO
@ GOLIOTH_DEBUG_LOG_LEVEL_DEBUG
void golioth_debug_hexdump(const char *tag, const void *addr, int len)