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#pragma once
7
8#include <golioth/config.h>
9#include <stdbool.h>
10#include <stdint.h>
11
12#ifndef __UNUSED
13#if defined(__GNUC__) || defined(__clang__)
14#define __UNUSED __attribute__((unused))
15#else /* defined(__GNUC__) || defined(__clang__) */
16#define __UNUSED
17#endif /* defined(__GNUC__) || defined(__clang__) */
18#endif /* __UNUSED */
19
20#ifndef LOG_TAG_DEFINE
21#define LOG_TAG_DEFINE(tag) static __UNUSED const char *TAG = #tag
22#endif
23
24struct golioth_client;
25
35
38void golioth_debug_hexdump(const char *tag, const void *addr, int len);
39void golioth_debug_set_client(struct golioth_client *client);
41void golioth_debug_printf(uint64_t tstamp_ms,
42 enum golioth_debug_log_level level,
43 const char *tag,
44 const char *format,
45 ...);
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)