]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
These are only some macros for logging support
authornauber <nauber@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Apr 1999 08:36:28 +0000 (08:36 +0000)
committernauber <nauber@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 20 Apr 1999 08:36:28 +0000 (08:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@1183 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/trace.h [new file with mode: 0644]

diff --git a/deal.II/base/include/base/trace.h b/deal.II/base/include/base/trace.h
new file mode 100644 (file)
index 0000000..4d3e3c1
--- /dev/null
@@ -0,0 +1,19 @@
+/* Tracing macros for logging purpose if DEBUG is set. */
+#ifndef __trace_h
+#define __trace_h
+#include <base/logstream.h>
+#ifdef DEBUG
+// Trace a variable, i.e. print variable name and value to deallog
+#define TRACEVAR(arg) deallog << __LINE__ << ": " << # arg << " = " << (arg) << endl; 
+// Trace a message, i.e. print message to deallog
+#define TRACEMSG(arg) deallog << __LINE__ << ": " << arg << endl;
+// Trace vector, i.e. print vector components to deallog
+#define TRACEVEC(arg) deallog << __LINE__ << ": " << #arg << " = "; \
+                      for(int TRACE_i = 0; TRACE_i < arg.size(); TRACE_i ++) deallog << arg(TRACE_i) << " "; \
+                      deallog << endl;
+#else
+#define TRACEVAR(arg)
+#define TRACEMSG(arg)
+#define TRACEVEC(arg)
+#endif
+#endif

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.