From 07a38572caa2c2d2d8658420a7c3df8e7f9d0e74 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Sun, 21 Jan 2018 06:44:18 -0800 Subject: Add logging support Change-Id: Ieac9cf50156dbbb4962411e900d59256441915ef Signed-off-by: Damjan Marion Signed-off-by: Klement Sekera --- src/vnet/devices/tap/tap.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vnet/devices/tap/tap.c') diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index 8005b347391..7cffaafb1e2 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -519,11 +520,19 @@ tap_dump_ifs (tap_interface_details_t ** out_tapids) return 0; } +#define vlib_log_info(...) vlib_log(VLIB_LOG_LEVEL_INFO, __VA_ARGS__) + static clib_error_t * tap_init (vlib_main_t * vm) { tap_main_t *tm = &tap_main; + clib_error_t *error; + error = vlib_call_init_function (vm, vlib_log_init); + if (error) + return error; tm->dev_instance_by_interface_id = hash_create (0, sizeof (uword)); + tm->log_default = vlib_log_register_class ("tap", 0); + vlib_log_info (tm->log_default, "initialized"); return 0; } -- cgit 1.2.3-korg