[Rcpp-commits] r198 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 19 17:20:52 CET 2009


Author: edd
Date: 2009-12-19 17:20:52 +0100 (Sat, 19 Dec 2009)
New Revision: 198

Modified:
   pkg/src/RcppCommon.cpp
   pkg/src/RcppCommon.h
Log:
simple logging facility


Modified: pkg/src/RcppCommon.cpp
===================================================================
--- pkg/src/RcppCommon.cpp	2009-12-18 16:12:43 UTC (rev 197)
+++ pkg/src/RcppCommon.cpp	2009-12-19 16:20:52 UTC (rev 198)
@@ -36,3 +36,6 @@
     return Rmesg;
 }
 
+inline void logTxtFunction(const char* file, const int line, const char* expression) {
+    Rprintf("%s:%d %s\n", file, line, expression);
+}

Modified: pkg/src/RcppCommon.h
===================================================================
--- pkg/src/RcppCommon.h	2009-12-18 16:12:43 UTC (rev 197)
+++ pkg/src/RcppCommon.h	2009-12-19 16:20:52 UTC (rev 198)
@@ -45,4 +45,10 @@
 
 char *copyMessageToR(const char* const mesg);
 
+// simple logging help
+inline void logTxtFunction(const char* file, const int line, const char* expression); 
+
+//#define logTxt(x) logTxtFunction(__FILE__, __LINE__, x);
+#define logTxt(x) 
+
 #endif



More information about the Rcpp-commits mailing list