diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h
index 092b99c6c5ff57ca47cf083bda680f2ef6189f40..fc0cfdf34faa893b5fd03a6df38b8a0f2816dd25 100755
--- a/openair1/PHY/defs.h
+++ b/openair1/PHY/defs.h
@@ -48,9 +48,14 @@
 #include <math.h>
 //#include <complex.h>
 #ifdef MEX
-#define msg mexPrintf
+# define msg mexPrintf
 #else
-#define msg printf   
+# ifdef OPENAIR2
+#   include "log.h"
+#   define msg(aRGS...) LOG_D(PHY, ##aRGS)
+# else
+#   define msg printf
+# endif
 #endif
 //use msg in the real-time thread context
 #define msg_nrt printf