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
201 changed files with 490 additions and 488 deletions
|
@ -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__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue