drivers: net: loopback: Convert to use new logging

Convert the driver to use the new logging system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2018-07-10 15:37:02 +03:00
parent 1fea1418de
commit d671c4693c
2 changed files with 11 additions and 19 deletions

View file

@ -95,18 +95,10 @@ menuconfig NET_LOOPBACK
if NET_LOOPBACK
config SYS_LOG_NET_LOOPBACK_LEVEL
int "Net loopback driver log level"
depends on SYS_LOG && NET_LOOPBACK
default 0
range 0 4
help
Sets log level for the driver.
Levels are:
0 OFF, do not write
1 ERROR, only write SYS_LOG_ERR
2 WARNING, write SYS_LOG_WRN in addition to previous level
3 INFO, write SYS_LOG_INF in addition to previous levels
4 DEBUG, write SYS_LOG_DBG in addition to previous levels
module=NET_LOOPBACK
module-dep=LOG
module-str=Log level for network loopback driver
module-help=Sets log level for network loopback driver.
source "subsys/net/Kconfig.template.log_config.net"
endif

View file

@ -11,11 +11,11 @@
* Network loopback interface implementation.
*/
#define SYS_LOG_DOMAIN "netlo"
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_NET_LOOPBACK_LEVEL
#include <logging/sys_log.h>
#define LOG_MODULE_NAME netlo
#define LOG_LEVEL CONFIG_NET_LOOPBACK_LOG_LEVEL
#include <misc/printk.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <net/net_pkt.h>
#include <net/buf.h>
@ -40,7 +40,7 @@ static int loopback_send(struct net_if *iface, struct net_pkt *pkt)
int res;
if (!pkt->frags) {
SYS_LOG_ERR("No data to send");
LOG_ERR("No data to send");
return -ENODATA;
}
@ -77,7 +77,7 @@ static int loopback_send(struct net_if *iface, struct net_pkt *pkt)
res = net_recv_data(iface, cloned);
if (res < 0) {
SYS_LOG_ERR("Data receive failed.");
LOG_ERR("Data receive failed.");
goto out;
}