nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
nrf_cloud_log.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_CLOUD_LOG_H_
8#define NRF_CLOUD_LOG_H_
9
14#include <zephyr/logging/log.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
21
32
43void nrf_cloud_log_rest_context_set(struct nrf_cloud_rest_context *ctx, const char *dev_id);
44
61
75void nrf_cloud_log_enable(bool enable);
76
83
93void nrf_cloud_log_control_set(int log_level);
94
101
108
115
116#if defined(CONFIG_NRF_CLOUD_LOG_DIRECT)
117
118#if defined(CONFIG_NRF_CLOUD_MQTT) || defined(CONFIG_NRF_CLOUD_COAP)
129int nrf_cloud_log_send(int log_level, const char *fmt, ...);
130#endif /* CONFIG_NRF_CLOUD_MQTT || CONFIG_NRF_CLOUD_COAP */
131
132#if defined(CONFIG_NRF_CLOUD_REST) || defined(__DOXYGEN__)
145int nrf_cloud_rest_log_send(struct nrf_cloud_rest_context *ctx, const char *dev_id,
146 int log_level, const char *fmt, ...);
147#endif /* CONFIG_NRF_CLOUD_REST || __DOXYGEN__ */
148
149#else /* CONFIG_NRF_CLOUD_LOG_DIRECT */
150#define nrf_cloud_log_send(log_level, fmt, ...) (0)
151#endif /* CONFIG_NRF_CLOUD_LOG_DIRECT */
152
155#ifdef __cplusplus
156}
157#endif
158
159#endif /* NRF_CLOUD_LOG_H_ */
bool nrf_cloud_is_dict_logging_enabled(void)
Determine if build is configured for dictionary (binary) logging.
int nrf_cloud_log_control_get(void)
Get current log level for logging to nRF Cloud.
void nrf_cloud_log_rest_context_set(struct nrf_cloud_rest_context *ctx, const char *dev_id)
Set REST context for logging subsystem.
void nrf_cloud_log_level_set(int level)
Set the logging level.
bool nrf_cloud_is_text_logging_enabled(void)
Determine if build is configured for text (JSON) cloud logging.
void nrf_cloud_log_init(void)
Initialize the nRF Cloud logging subsystem. Call after the date_time library is ready.
bool nrf_cloud_log_is_enabled(void)
Find out if logger is enabled.
void nrf_cloud_log_enable(bool enable)
Enable or disable logging to the cloud.
void nrf_cloud_log_control_set(int log_level)
Control nRF Cloud logging.
#define nrf_cloud_log_send(log_level, fmt,...)
Definition nrf_cloud_log.h:150
Parameters and data for using the nRF Cloud REST API.
Definition nrf_cloud_rest.h:58