Zephyr API Documentation
4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
net_log.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
14
15
#ifndef ZEPHYR_INCLUDE_NET_NET_LOG_H_
16
#define ZEPHYR_INCLUDE_NET_NET_LOG_H_
17
18
#include <
zephyr/logging/log.h
>
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
25
26
#ifdef CONFIG_THREAD_NAME
27
#define NET_DBG(fmt, ...) LOG_DBG("(%s): " fmt, \
28
k_thread_name_get(k_current_get()), \
29
##__VA_ARGS__)
30
#else
31
#define NET_DBG(fmt, ...) LOG_DBG("(%p): " fmt, k_current_get(), \
32
##__VA_ARGS__)
33
#endif
/* CONFIG_THREAD_NAME */
34
#define NET_ERR(fmt, ...) LOG_ERR(fmt, ##__VA_ARGS__)
35
#define NET_WARN(fmt, ...) LOG_WRN(fmt, ##__VA_ARGS__)
36
#define NET_INFO(fmt, ...) LOG_INF(fmt, ##__VA_ARGS__)
37
38
/* Rate-limited network logging macros */
39
#define NET_ERR_RATELIMIT(fmt, ...) LOG_ERR_RATELIMIT(fmt, ##__VA_ARGS__)
40
#define NET_WARN_RATELIMIT(fmt, ...) LOG_WRN_RATELIMIT(fmt, ##__VA_ARGS__)
41
#define NET_INFO_RATELIMIT(fmt, ...) LOG_INF_RATELIMIT(fmt, ##__VA_ARGS__)
42
#define NET_DBG_RATELIMIT(fmt, ...) LOG_DBG_RATELIMIT(fmt, ##__VA_ARGS__)
43
44
#define NET_HEXDUMP_DBG(_data, _length, _str) LOG_HEXDUMP_DBG(_data, _length, _str)
45
#define NET_HEXDUMP_ERR(_data, _length, _str) LOG_HEXDUMP_ERR(_data, _length, _str)
46
#define NET_HEXDUMP_WARN(_data, _length, _str) LOG_HEXDUMP_WRN(_data, _length, _str)
47
#define NET_HEXDUMP_INFO(_data, _length, _str) LOG_HEXDUMP_INF(_data, _length, _str)
48
50
51
#ifdef __cplusplus
52
}
53
#endif
54
55
#endif
/* ZEPHYR_INCLUDE_NET_NET_LOG_H_ */
log.h
zephyr
net
net_log.h
Generated on
for Zephyr API Documentation by
1.16.1