Skip to content

Commit ac6ec7f

Browse files
committed
net: sockets: Add debug logging config
Signed-off-by: Paul Sokolovsky <[email protected]>
1 parent f73a3b8 commit ac6ec7f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

subsys/net/lib/sockets/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,11 @@ config NET_SOCKETS_POSIX_NAMES
2525
attention, as in POSIX it closes any file descriptor, while with this
2626
option enaled, it will still apply only to sockets.
2727

28+
config NET_DEBUG_SOCKETS
29+
bool "Debug BSD Sockets like API calls"
30+
default n
31+
help
32+
Enables logging for sockets code. (Logging level is defined by
33+
SYS_LOG_NET_LEVEL setting).
34+
2835
endif # NET_SOCKETS

subsys/net/lib/sockets/sockets.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#if defined(CONFIG_NET_DEBUG_SOCKETS)
8+
#define SYS_LOG_DOMAIN "net/sock"
9+
#define NET_LOG_ENABLED 1
10+
#endif
11+
712
#include <net/net_context.h>
813
#include <net/net_pkt.h>
914
#include <net/socket.h>

0 commit comments

Comments
 (0)