nRF Connect SDK API
0.1.0
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
17
extern
"C"
{
18
#endif
19
20
struct
nrf_cloud_rest_context
;
21
31
void
nrf_cloud_log_init
(
void
);
32
43
void
nrf_cloud_log_rest_context_set
(
struct
nrf_cloud_rest_context
*ctx,
const
char
*dev_id);
44
60
void
nrf_cloud_log_level_set
(
int
level);
61
75
void
nrf_cloud_log_enable
(
bool
enable);
76
82
bool
nrf_cloud_log_is_enabled
(
void
);
83
93
void
nrf_cloud_log_control_set
(
int
log_level);
94
100
int
nrf_cloud_log_control_get
(
void
);
101
107
bool
nrf_cloud_is_text_logging_enabled
(
void
);
108
114
bool
nrf_cloud_is_dict_logging_enabled
(
void
);
115
116
#if defined(CONFIG_NRF_CLOUD_LOG_DIRECT)
117
118
#if defined(CONFIG_NRF_CLOUD_MQTT) || defined(CONFIG_NRF_CLOUD_COAP)
129
int
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__)
145
int
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_ */
nrf_cloud_is_dict_logging_enabled
bool nrf_cloud_is_dict_logging_enabled(void)
Determine if build is configured for dictionary (binary) logging.
nrf_cloud_log_control_get
int nrf_cloud_log_control_get(void)
Get current log level for logging to nRF Cloud.
nrf_cloud_log_rest_context_set
void nrf_cloud_log_rest_context_set(struct nrf_cloud_rest_context *ctx, const char *dev_id)
Set REST context for logging subsystem.
nrf_cloud_log_level_set
void nrf_cloud_log_level_set(int level)
Set the logging level.
nrf_cloud_is_text_logging_enabled
bool nrf_cloud_is_text_logging_enabled(void)
Determine if build is configured for text (JSON) cloud logging.
nrf_cloud_log_init
void nrf_cloud_log_init(void)
Initialize the nRF Cloud logging subsystem. Call after the date_time library is ready.
nrf_cloud_log_is_enabled
bool nrf_cloud_log_is_enabled(void)
Find out if logger is enabled.
nrf_cloud_log_enable
void nrf_cloud_log_enable(bool enable)
Enable or disable logging to the cloud.
nrf_cloud_log_control_set
void nrf_cloud_log_control_set(int log_level)
Control nRF Cloud logging.
nrf_cloud_log_send
#define nrf_cloud_log_send(log_level, fmt,...)
Definition:
nrf_cloud_log.h:150
nrf_cloud_rest_context
Parameters and data for using the nRF Cloud REST API.
Definition:
nrf_cloud_rest.h:58
include
net
nrf_cloud_log.h
Generated on Thu Sep 26 2024 10:53:16 for nRF Connect SDK API by
1.9.6