diff mbox

[6/6] netdev-odp: implemenet odp_override_log

Message ID 1426792426-12507-7-git-send-email-zoltan.kiss@linaro.org
State New
Headers show

Commit Message

Zoltan Kiss March 19, 2015, 7:13 p.m. UTC
ODP logs now end up in OVS logs.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 lib/netdev-odp.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff mbox

Patch

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 87f6ec4..7176992 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -639,6 +639,24 @@  out_stats:
     return ret;
 }
 
+int odp_override_log(odp_log_level_e level, const char *fmt, ...)
+{
+    va_list args;
+    enum vlog_level ovs_level;
+    if (level == ODP_LOG_DBG)
+        ovs_level = VLL_DBG;
+    else if (level == ODP_LOG_PRINT)
+        ovs_level = VLL_INFO;
+    else
+        ovs_level = VLL_ERR;
+
+    va_start(args, fmt);
+    vlog_rate_limit_valist(THIS_MODULE, ovs_level, &rl, fmt, args);
+    va_end(args);
+
+    return 0;
+}
+
 static struct netdev_class netdev_odp_class = {
     "odp",
     odp_class_init,             /* init */