diff mbox

[v2,6/6] netdev-odp: implemenet odp_override_log

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

Commit Message

Zoltan Kiss March 26, 2015, 7:23 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 fa325faa..765edee 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -635,6 +635,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 */