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 <golioth/golioth_sys.h>
16#include <stdbool.h>
17#include <stdint.h>
18
19#ifndef __UNUSED
20#if defined(__GNUC__) || defined(__clang__)
21#define __UNUSED __attribute__((unused))
22#else /* defined(__GNUC__) || defined(__clang__) */
23#define __UNUSED
24#endif /* defined(__GNUC__) || defined(__clang__) */
25#endif /* __UNUSED */
26
27#ifndef LOG_TAG_DEFINE
28#define LOG_TAG_DEFINE(tag) static __UNUSED const char *TAG = #tag
29#endif
30
31struct golioth_client;
32
42
45void golioth_debug_hexdump(const char *tag, const void *addr, int len);
46void golioth_debug_set_client(struct golioth_client *client);
48void golioth_debug_printf(uint64_t tstamp_ms,
49 enum golioth_debug_log_level level,
50 const char *tag,
51 const char *format,
52 ...);
53
54#ifdef __cplusplus
55}
56#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)