vcl: basic support for apps that fork
[vpp.git] / src / vcl / vcl_debug.h
index 13e6726..191d400 100644 (file)
 #include <vppinfra/elog.h>
 
 #define VCL_ELOG       0
+#define VCL_DBG_ON     1
 
 #define VDBG(_lvl, _fmt, _args...)                                     \
-  if (vcm->debug > _lvl)                                               \
-    clib_warning (_fmt, ##_args)
+  if (VCL_DBG_ON && vcm->debug > _lvl)                                 \
+    clib_warning ("vcl<%d:%d>: " _fmt,                                         \
+                 vcm->workers[__vcl_worker_index].current_pid,         \
+                 __vcl_worker_index, ##_args)
+
+#define VWRN(_fmt, _args...)                                           \
+  clib_warning ("vcl<%d:%d>: " _fmt,                                   \
+                vcm->workers[__vcl_worker_index].current_pid,          \
+                __vcl_worker_index, ##_args)
+
+#define VERR(_fmt, _args...)                                           \
+  clib_warning ("vcl<%d:%d>: ERROR " _fmt,                             \
+                vcm->workers[__vcl_worker_index].current_pid,          \
+               __vcl_worker_index, ##_args)
 
 #define foreach_vcl_dbg_evt                                            \
   _(INIT, "vcl init track")                                            \