diff options
author | Damjan Marion <damarion@cisco.com> | 2020-10-21 12:43:40 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-10-21 17:46:01 +0000 |
commit | 06d82260d9913dbb6be98aef00830ef4967b1f55 (patch) | |
tree | b17623257674ab57fb912b805a57b29211975cd2 /src/plugins | |
parent | 210fda269147e47ff434c0a194d17e6cef0fdd74 (diff) |
vlib: print logs to stderr if interactive or nosyslog set
If VPP is started in interactive mode, instead of sending logs to syslog
server we print them directly to stderr.
Output is colorized, but that can be turned off with unix { nocolor }
Type: improvement
Change-Id: I9a0f0803e4cba2849a6efa0b6a86b9614ed33ced
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/dhcp/client.c | 2 | ||||
-rw-r--r-- | src/plugins/dpdk/cryptodev/cryptodev.c | 5 | ||||
-rw-r--r-- | src/plugins/dpdk/cryptodev/cryptodev_dp_api.c | 5 | ||||
-rw-r--r-- | src/plugins/dpdk/device/dpdk.h | 2 | ||||
-rw-r--r-- | src/plugins/dpdk/device/init.c | 12 | ||||
-rw-r--r-- | src/plugins/dpdk/ipsec/ipsec.c | 4 |
6 files changed, 17 insertions, 13 deletions
diff --git a/src/plugins/dhcp/client.c b/src/plugins/dhcp/client.c index cd90df6a244..575f8b82625 100644 --- a/src/plugins/dhcp/client.c +++ b/src/plugins/dhcp/client.c @@ -1250,7 +1250,7 @@ dhcp_client_init (vlib_main_t * vm) dcm->seed = (u32) clib_cpu_time_now (); dhcp_logger = vlib_log_register_class ("dhcp", "client"); - DHCP_INFO ("plugin initialized"); + DHCP_DBG ("plugin initialized"); return 0; } diff --git a/src/plugins/dpdk/cryptodev/cryptodev.c b/src/plugins/dpdk/cryptodev/cryptodev.c index 68a9126c3ae..f58b54634a7 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev.c +++ b/src/plugins/dpdk/cryptodev/cryptodev.c @@ -1201,10 +1201,7 @@ cryptodev_get_session_sz (vlib_main_t *vm, uint32_t n_workers) u32 sess_data_sz = 0, i; if (rte_cryptodev_count () == 0) - { - clib_warning ("No cryptodev device available"); - return -1; - } + return -1; for (i = 0; i < rte_cryptodev_count (); i++) { diff --git a/src/plugins/dpdk/cryptodev/cryptodev_dp_api.c b/src/plugins/dpdk/cryptodev/cryptodev_dp_api.c index 8fcfa2edf48..682295b703c 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev_dp_api.c +++ b/src/plugins/dpdk/cryptodev/cryptodev_dp_api.c @@ -1348,10 +1348,7 @@ cryptodev_get_session_sz (vlib_main_t *vm, u32 n_workers) u32 sess_data_sz = 0, i; if (rte_cryptodev_count () == 0) - { - clib_warning ("Failed"); - return -1; - } + return -1; for (i = 0; i < rte_cryptodev_count (); i++) { diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h index 94842a56397..b094a1931cf 100644 --- a/src/plugins/dpdk/device/dpdk.h +++ b/src/plugins/dpdk/device/dpdk.h @@ -346,6 +346,8 @@ typedef struct /* logging */ vlib_log_class_t log_default; + vlib_log_class_t log_cryptodev; + vlib_log_class_t log_ipsec; } dpdk_main_t; extern dpdk_main_t dpdk_main; diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 2615f16364d..4b200cef8bb 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -862,7 +862,8 @@ dpdk_bind_devices_to_uio (dpdk_config_main_t * conf) d = vlib_pci_get_device_info (vm, addr, &error); if (error) { - clib_error_report (error); + vlib_log_warn (dpdk_main.log_default, "%U", format_clib_error, error); + clib_error_free (error); continue; } @@ -1507,7 +1508,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input) vec_terminate_c_string (conf->eal_init_args_str); - dpdk_log_warn ("EAL init args: %s", conf->eal_init_args_str); + dpdk_log_notice ("EAL init args: %s", conf->eal_init_args_str); ret = rte_eal_init (vec_len (conf->eal_init_args), (char **) conf->eal_init_args); @@ -1636,7 +1637,10 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) error = dpdk_cryptodev_init (vm); if (error) - clib_error_report (error); + { + vlib_log_warn (dpdk_main.log_cryptodev, "%U", format_clib_error, error); + clib_error_free (error); + } tm->worker_thread_release = 1; @@ -1720,6 +1724,8 @@ dpdk_init (vlib_main_t * vm) dm->link_state_poll_interval = DPDK_LINK_POLL_INTERVAL; dm->log_default = vlib_log_register_class ("dpdk", 0); + dm->log_cryptodev = vlib_log_register_class ("dpdk", "cryptodev"); + dm->log_ipsec = vlib_log_register_class ("dpdk", "ipsec"); return error; } diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c index db2b1d6c2e9..c7fd9222824 100644 --- a/src/plugins/dpdk/ipsec/ipsec.c +++ b/src/plugins/dpdk/ipsec/ipsec.c @@ -17,6 +17,7 @@ #include <vnet/api_errno.h> #include <vnet/ipsec/ipsec.h> #include <vlib/node_funcs.h> +#include <vlib/log.h> #include <dpdk/device/dpdk.h> #include <dpdk/buffer.h> @@ -1028,7 +1029,8 @@ dpdk_ipsec_main_init (vlib_main_t * vm) if (!(dcm->enabled)) { - clib_warning ("not enough DPDK crypto resources, default to OpenSSL"); + vlib_log_warn (dpdk_main.log_default, + "not enough DPDK crypto resources"); crypto_disable (); return 0; } |