net: Clarify logging in networking code
Remove network specific default and max log level setting and start to use the zephyr logging values for those. Remove LOG_MODULE_REGISTER() from net_core.h and place the calls into .c files. This is done in order to avoid weird compiler errors in some cases and to make the code look similar as other subsystems. Fixes #11343 Fixes #11659 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
7ab2827035
commit
86689030e8
|
@ -34,26 +34,8 @@ extern "C" {
|
|||
*/
|
||||
|
||||
/* Network subsystem logging helpers */
|
||||
|
||||
#if !defined(LOG_LEVEL)
|
||||
#if !defined(NET_LOG_LEVEL)
|
||||
#define NET_LOG_LEVEL CONFIG_NET_DEFAULT_LOG_LEVEL
|
||||
#endif /* !NET_LOG_LEVEL */
|
||||
|
||||
#if NET_LOG_LEVEL > CONFIG_NET_MAX_LOG_LEVEL
|
||||
#undef NET_LOG_LEVEL
|
||||
#define NET_LOG_LEVEL CONFIG_NET_MAX_LOG_LEVEL
|
||||
#endif /* NET_LOG_LEVEL > CONFIG_NET_MAX_LOG_LEVEL */
|
||||
|
||||
#define LOG_LEVEL NET_LOG_LEVEL
|
||||
#endif /* !LOG_LEVEL */
|
||||
|
||||
#if defined(NET_LOG_LEVEL)
|
||||
#include <logging/log.h>
|
||||
|
||||
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
||||
#endif /* NET_LOG_LEVEL */
|
||||
|
||||
#if defined(CONFIG_LOG_FUNCTION_NAME)
|
||||
#define NET_DBG(fmt, ...) LOG_DBG("(%p): " fmt, k_current_get(), \
|
||||
##__VA_ARGS__)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_coap_client
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_coap_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/printk.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_coap_server
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_coap_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/printk.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_dhcpv4_client
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_dhcpv4_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_dns_resolve_client
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_dns_resolve_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* This might not be what you want to do in your app so caveat emptor.
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client_tcp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client_udp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client_vlan
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server_tcp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server_udp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server_vlan
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_native_posix
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_native_posix_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_gptp_app
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_gptp_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_http_client_sample
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_http_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
#else
|
||||
#define LOG_MODULE_NAME net_http_server_sample
|
||||
#endif
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(LOG_MODULE_NAME, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv4_autoconf_sample
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ipv4_autoconf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_irc_bot
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_irc_bot_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <random/rand32.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_leds_demo
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_leds_demo_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_lldp_app
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_lldp_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_mdns_responder_app
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_mdns_responder_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <net/net_core.h>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_mqtt_publisher_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <net/socket.h>
|
||||
#include <net/mqtt.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_nats_app_main
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_nats_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <gpio.h>
|
||||
#include <net/net_context.h>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_nats_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <json.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_promisc_sample
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_promisc_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_br_coap
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_rpl_br_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_br_http
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_rpl_br_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_br_main
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_rpl_br_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_br_rpl
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#define LOG_LEVEL LOG_LEVEL_DBG
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_rpl_br_sample, LOG_LEVEL);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdio.h>
|
||||
|
@ -42,7 +44,7 @@ static bool br_join_dag(struct net_rpl_dio *dio)
|
|||
rpl.dag_has_version = true;
|
||||
}
|
||||
} else {
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
char me[NET_IPV6_ADDR_LEN];
|
||||
char other[NET_IPV6_ADDR_LEN];
|
||||
|
||||
|
@ -119,7 +121,7 @@ bool setup_rpl(struct net_if *iface, const char *addr_prefix)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
char out[NET_IPV6_ADDR_LEN];
|
||||
|
||||
if (net_addr_ntop(AF_INET6, &rpl.prefix, out,
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_br_shell
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_rpl_br_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <shell/shell.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_node
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_rpl_node_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_sntp_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <misc/printk.h>
|
||||
#include <net/sntp.h>
|
||||
|
|
|
@ -20,8 +20,9 @@
|
|||
#include <netdb.h>
|
||||
|
||||
#else
|
||||
#define LOG_MODULE_NAME net_big_http_download
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_big_http_download_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <net/socket.h>
|
||||
#include <kernel.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_coap_client
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_coap_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/printk.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_coap_server
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_coap_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/printk.h>
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#else
|
||||
#define LOG_MODULE_NAME net_dump_http_download
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_dump_http_download_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <net/socket.h>
|
||||
#include <kernel.h>
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
#else
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_socket_echo_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <net/socket.h>
|
||||
#include <kernel.h>
|
||||
#include <net/net_app.h>
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
#else
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_echo_async_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <sys/fcntl.h>
|
||||
#include <net/socket.h>
|
||||
#include <kernel.h>
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* This might not be what you want to do in your app so caveat emptor.
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client_tcp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client_udp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_client_vlan
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_client_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server_tcp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server_udp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_echo_server_vlan
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include <netdb.h>
|
||||
|
||||
#else
|
||||
#define LOG_MODULE_NAME net_http_get
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_http_get_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <net/socket.h>
|
||||
#include <kernel.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_stats_sample
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_stats_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_syslog
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_syslog, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_telnet_setup
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_telnet_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_tp_server
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_tp_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_tp_server_udp
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_tp_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_tc_app
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_tc_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_vlan_app
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_vlan_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
* with popular Contiki-based native border routers.
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_wpan_serial
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_wpan_serial_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <string.h>
|
||||
#include <device.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ws_console_main
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ws_console_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ws_console_sample
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
|
||||
/* Printing debugs from this module looks funny in console so do not
|
||||
* do it unless you are debugging this module.
|
||||
*/
|
||||
#define EXTRA_DEBUG 0
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_ws_console_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ws_echo_server_main
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ws_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <linker/sections.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ws_echo_server_sample
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_ws_echo_server_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -4,9 +4,6 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_shell_utils
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
|
||||
#include <ctype.h>
|
||||
#include <misc/printk.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_session
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_shell
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_zperf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_tcp_recv
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_tcp_send
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_udp_recv
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <linker/sections.h>
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_zperf_udp_send
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_DBG
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_zperf_sample, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(log_backend_net, CONFIG_LOG_DEFAULT_LEVEL);
|
||||
|
||||
#include <logging/log_backend.h>
|
||||
#include <logging/log_core.h>
|
||||
#include <logging/log_output.h>
|
||||
|
|
|
@ -54,4 +54,4 @@ config $(module)_LOG_LEVEL
|
|||
default 2 if $(module)_LOG_LEVEL_WRN
|
||||
default 3 if $(module)_LOG_LEVEL_INF
|
||||
default 4 if $(module)_LOG_LEVEL_DBG
|
||||
default NET_DEFAULT_LOG_LEVEL if $(module)_LOG_LEVEL_DEFAULT
|
||||
default LOG_DEFAULT_LEVEL if $(module)_LOG_LEVEL_DEFAULT
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_hostname
|
||||
#define NET_LOG_LEVEL CONFIG_NET_HOSTNAME_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_hostname, CONFIG_NET_HOSTNAME_LOG_LEVEL);
|
||||
|
||||
#include <zephyr.h>
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_6lo
|
||||
#define NET_LOG_LEVEL CONFIG_NET_6LO_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_6lo, CONFIG_NET_6LO_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <net/net_core.h>
|
||||
|
|
|
@ -14,20 +14,6 @@ menuconfig NET_LOG
|
|||
Specific debugging options to other sub-menus will be unlocked
|
||||
as well (IPv6, IPv4, ...).
|
||||
|
||||
module = NET_DEFAULT
|
||||
module-dep = NET_LOG
|
||||
module-def = LOG_LEVEL_ERR
|
||||
module-str = Default network stack logging level
|
||||
module-help = Default log level if the user has not specified one.
|
||||
source "subsys/net/Kconfig.template.log_config.default.net"
|
||||
|
||||
module = NET_MAX
|
||||
module-dep = NET_LOG
|
||||
module-def = LOG_LEVEL_DBG
|
||||
module-str = Max network stack logging level
|
||||
module-help = Max log level. This overrides individual networking log levels.
|
||||
source "subsys/net/Kconfig.template.log_config.default.net"
|
||||
|
||||
module = NET_CORE
|
||||
module-dep = NET_LOG
|
||||
module-str = Log level for core IP stack
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_conn
|
||||
#define NET_LOG_LEVEL CONFIG_NET_CONN_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_conn, CONFIG_NET_CONN_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/util.h>
|
||||
|
@ -675,7 +675,7 @@ int net_conn_register(enum net_ip_protocol proto,
|
|||
/* Cache needs to be cleared if new entries are added. */
|
||||
cache_clear();
|
||||
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_CONN_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
char dst[NET_IPV6_ADDR_LEN];
|
||||
char src[NET_IPV6_ADDR_LEN];
|
||||
|
||||
|
@ -854,7 +854,7 @@ enum net_verdict net_conn_input(enum net_ip_protocol proto, struct net_pkt *pkt)
|
|||
return NET_DROP;
|
||||
}
|
||||
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_CONN_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
int data_len = -1;
|
||||
|
||||
if (IS_ENABLED(CONFIG_NET_IPV4) &&
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_dhcpv4
|
||||
#define NET_LOG_LEVEL CONFIG_NET_DHCPV4_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_dhcpv4, CONFIG_NET_DHCPV4_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_icmpv4
|
||||
#define NET_LOG_LEVEL CONFIG_NET_ICMPV4_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_icmpv4, CONFIG_NET_ICMPV4_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/slist.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_icmpv6
|
||||
#define NET_LOG_LEVEL CONFIG_NET_ICMPV6_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_icmpv6, CONFIG_NET_ICMPV6_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/slist.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv4
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV4_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ipv4, CONFIG_NET_IPV4_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <net/net_core.h>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv4_autoconf
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV4_AUTO_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ipv4_autoconf, CONFIG_NET_IPV4_AUTO_LOG_LEVEL);
|
||||
|
||||
#include "net_private.h"
|
||||
#include <errno.h>
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv6
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV6_LOG_LEVEL
|
||||
|
||||
/* By default this prints too much data, set the value to 1 to see
|
||||
* neighbor cache contents.
|
||||
*/
|
||||
#define NET_DEBUG_NBR 0
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ipv6, CONFIG_NET_IPV6_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <net/net_core.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv6_frag
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV6_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_ipv6, CONFIG_NET_IPV6_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <net/net_core.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv6_mld
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV6_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_ipv6, CONFIG_NET_IPV6_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <net/net_core.h>
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ipv6_nbr
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV6_LOG_LEVEL
|
||||
|
||||
/* By default this prints too much data, set the value to 1 to see
|
||||
* neighbor cache contents.
|
||||
*/
|
||||
#define NET_DEBUG_NBR 0
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_ipv6, CONFIG_NET_IPV6_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <net/net_core.h>
|
||||
|
@ -1204,7 +1204,7 @@ static void ns_routing_info(struct net_pkt *pkt,
|
|||
struct in6_addr *nexthop,
|
||||
struct in6_addr *tgt)
|
||||
{
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_IPV6_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
char out[NET_IPV6_ADDR_LEN];
|
||||
|
||||
snprintk(out, sizeof(out), "%s",
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_nbr
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IPV6_NBR_CACHE_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_nbr, CONFIG_NET_IPV6_NBR_CACHE_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -206,7 +206,7 @@ void net_nbr_clear_table(struct net_nbr_table *table)
|
|||
|
||||
void net_nbr_print(struct net_nbr_table *table)
|
||||
{
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_IPV6_NBR_CACHE_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < table->nbr_count; i++) {
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_ctx
|
||||
#define NET_LOG_LEVEL CONFIG_NET_CONTEXT_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_ctx, CONFIG_NET_CONTEXT_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_core
|
||||
#define NET_LOG_LEVEL CONFIG_NET_CORE_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_core, CONFIG_NET_CORE_LOG_LEVEL);
|
||||
|
||||
#include <init.h>
|
||||
#include <kernel.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_if
|
||||
#define NET_LOG_LEVEL CONFIG_NET_IF_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_if, CONFIG_NET_IF_LOG_LEVEL);
|
||||
|
||||
#include <init.h>
|
||||
#include <kernel.h>
|
||||
|
@ -97,7 +97,7 @@ static struct k_thread tx_thread_ts;
|
|||
static sys_slist_t timestamp_callbacks;
|
||||
#endif /* CONFIG_NET_PKT_TIMESTAMP */
|
||||
|
||||
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
#if CONFIG_NET_IF_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
#if defined(CONFIG_NET_STATISTICS)
|
||||
#define debug_check_packet(pkt) \
|
||||
do { \
|
||||
|
@ -119,7 +119,7 @@ static sys_slist_t timestamp_callbacks;
|
|||
#endif /* CONFIG_NET_STATISTICS */
|
||||
#else
|
||||
#define debug_check_packet(...)
|
||||
#endif /* NET_LOG_LEVEL >= LOG_LEVEL_DBG */
|
||||
#endif /* CONFIG_NET_IF_LOG_LEVEL >= LOG_LEVEL_DBG */
|
||||
|
||||
static inline void net_context_send_cb(struct net_context *context,
|
||||
void *token, int status)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_mgmt
|
||||
#define NET_LOG_LEVEL CONFIG_NET_MGMT_EVENT_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_mgmt, CONFIG_NET_MGMT_EVENT_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <toolchain.h>
|
||||
|
|
|
@ -10,17 +10,19 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_pkt
|
||||
#define NET_LOG_LEVEL CONFIG_NET_PKT_LOG_LEVEL
|
||||
|
||||
/* This enables allocation debugging but does not print so much output
|
||||
* as that can slow things down a lot.
|
||||
*/
|
||||
#if defined(CONFIG_NET_DEBUG_NET_PKT_ALL)
|
||||
#undef NET_LOG_LEVEL
|
||||
#if defined(CONFIG_NET_DEBUG_NET_PKT_ALL)
|
||||
#define NET_LOG_LEVEL 5
|
||||
#else
|
||||
#define NET_LOG_LEVEL CONFIG_NET_PKT_LOG_LEVEL
|
||||
#endif
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_pkt, NET_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <toolchain.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_shell
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_shell, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -4,14 +4,15 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_stats
|
||||
|
||||
#if defined(CONFIG_NET_STATISTICS_PERIODIC_OUTPUT)
|
||||
#define NET_LOG_LEVEL LOG_LEVEL_INF
|
||||
#else
|
||||
#define NET_LOG_LEVEL CONFIG_NET_STATISTICS_LOG_LEVEL
|
||||
#endif
|
||||
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_stats, NET_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_tc
|
||||
#define NET_LOG_LEVEL CONFIG_NET_TC_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_tc, CONFIG_NET_TC_LOG_LEVEL);
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_promisc
|
||||
#define NET_LOG_LEVEL CONFIG_NET_PROMISC_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_promisc, CONFIG_NET_PROMISC_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_route
|
||||
#define NET_LOG_LEVEL CONFIG_NET_ROUTE_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_route, CONFIG_NET_ROUTE_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <limits.h>
|
||||
|
@ -234,7 +234,7 @@ static int nbr_nexthop_put(struct net_nbr *nbr)
|
|||
|
||||
|
||||
#define net_route_info(str, route, dst) \
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) { \
|
||||
if (CONFIG_NET_ROUTE_LOG_LEVEL >= LOG_LEVEL_DBG) { \
|
||||
struct in6_addr *naddr = net_route_get_nexthop(route); \
|
||||
\
|
||||
NET_ASSERT_INFO(naddr, "Unknown nexthop address"); \
|
||||
|
@ -356,7 +356,7 @@ struct net_route_entry *net_route_add(struct net_if *iface,
|
|||
struct net_route_entry,
|
||||
node);
|
||||
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_ROUTE_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
struct in6_addr *tmp;
|
||||
struct net_linkaddr_storage *llstorage;
|
||||
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_mrhof
|
||||
#define NET_LOG_LEVEL CONFIG_NET_RPL_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_rpl, CONFIG_NET_RPL_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <limits.h>
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl_of0
|
||||
#define NET_LOG_LEVEL CONFIG_NET_RPL_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_rpl, CONFIG_NET_RPL_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <limits.h>
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_rpl
|
||||
#define NET_LOG_LEVEL CONFIG_NET_RPL_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_rpl, CONFIG_NET_RPL_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <limits.h>
|
||||
|
@ -352,7 +352,7 @@ int net_rpl_foreach_parent(net_rpl_parent_cb_t cb, void *user_data)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
#if CONFIG_NET_RPL_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
static void net_rpl_print_parents(void)
|
||||
{
|
||||
struct net_rpl_parent *parent;
|
||||
|
@ -1548,7 +1548,7 @@ static void net_rpl_remove_parent(struct net_if *iface,
|
|||
}
|
||||
}
|
||||
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_RPL_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
struct in6_addr *addr;
|
||||
struct net_linkaddr_storage *lladdr;
|
||||
|
||||
|
@ -2053,7 +2053,7 @@ static bool net_rpl_process_parent_event(struct net_if *iface,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_RPL_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
u16_t old_rank = instance->current_dag->rank;
|
||||
|
||||
if (NET_RPL_DAG_RANK(old_rank, instance) !=
|
||||
|
@ -3534,7 +3534,7 @@ static enum net_verdict handle_dao(struct net_pkt *pkt)
|
|||
if (dag->preferred_parent) {
|
||||
r = forwarding_dao(instance, dag,
|
||||
pkt, sequence, flags,
|
||||
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
#if CONFIG_NET_RPL_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
"Forwarding no-path DAO to "
|
||||
"parent"
|
||||
#else
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_tcp
|
||||
#define NET_LOG_LEVEL CONFIG_NET_TCP_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_tcp, CONFIG_NET_TCP_LOG_LEVEL);
|
||||
|
||||
#include <kernel.h>
|
||||
#include <string.h>
|
||||
|
@ -115,7 +115,7 @@ static void net_tcp_trace(struct net_pkt *pkt, struct net_tcp *tcp)
|
|||
u32_t rel_ack, ack;
|
||||
u8_t flags;
|
||||
|
||||
if (NET_LOG_LEVEL < LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_TCP_LOG_LEVEL < LOG_LEVEL_DBG) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -776,7 +776,7 @@ int net_tcp_prepare_reset(struct net_tcp *tcp,
|
|||
|
||||
const char *net_tcp_state_str(enum net_tcp_state state)
|
||||
{
|
||||
#if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) || defined(CONFIG_NET_SHELL)
|
||||
#if (CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG) || defined(CONFIG_NET_SHELL)
|
||||
switch (state) {
|
||||
case NET_TCP_CLOSED:
|
||||
return "CLOSED";
|
||||
|
@ -1114,7 +1114,7 @@ void net_tcp_init(void)
|
|||
{
|
||||
}
|
||||
|
||||
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
#if CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG
|
||||
static void validate_state_transition(enum net_tcp_state current,
|
||||
enum net_tcp_state new)
|
||||
{
|
||||
|
@ -1279,7 +1279,7 @@ struct net_tcp_hdr *net_tcp_get_hdr(struct net_pkt *pkt,
|
|||
/* If the pkt is compressed, then this is the typical outcome
|
||||
* so no use printing error in this case.
|
||||
*/
|
||||
if ((NET_LOG_LEVEL >= LOG_LEVEL_DBG) &&
|
||||
if ((CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG) &&
|
||||
!is_6lo_technology(pkt)) {
|
||||
NET_ASSERT(frag);
|
||||
}
|
||||
|
@ -1858,7 +1858,7 @@ int net_tcp_unref(struct net_context *context)
|
|||
|
||||
static void print_send_info(struct net_pkt *pkt, const char *msg)
|
||||
{
|
||||
if (NET_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
if (CONFIG_NET_TCP_LOG_LEVEL >= LOG_LEVEL_DBG) {
|
||||
struct net_tcp_hdr hdr, *tcp_hdr;
|
||||
|
||||
tcp_hdr = net_tcp_get_hdr(pkt, &hdr);
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_trickle
|
||||
#define NET_LOG_LEVEL CONFIG_NET_TRICKLE_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_trickle, CONFIG_NET_TRICKLE_LOG_LEVEL);
|
||||
|
||||
#include <errno.h>
|
||||
#include <misc/util.h>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_udp
|
||||
#define NET_LOG_LEVEL CONFIG_NET_UDP_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_udp, CONFIG_NET_UDP_LOG_LEVEL);
|
||||
|
||||
#include "net_private.h"
|
||||
#include "udp_internal.h"
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define LOG_MODULE_NAME net_utils
|
||||
#define NET_LOG_LEVEL CONFIG_NET_UTILS_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(net_utils, CONFIG_NET_UTILS_LOG_LEVEL);
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <zephyr/types.h>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue