commit 2092663365f9f5b1b79b4e5de599cf9b9abc4210
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Aug 31 12:54:53 2023 +0200

    Add _v_() debug helper maco
    
    This can be used with streams.
      LYXERR0(_v_(var))
    leads to the message
     "var=<value of var>"
---
 src/support/debug.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/support/debug.h b/src/support/debug.h
index e284b94..f823ee1 100644
--- a/src/support/debug.h
+++ b/src/support/debug.h
@@ -262,4 +262,13 @@ extern LyXErr lyxerr;
        } while (0)
 
 
+/** Helper debug macro for quick and dirty logging. For example
+ *   int var = 2;
+ *   LYXERR0(_v_(var) << _v_(var + 1));
+ * yields
+ *   var=2 var + 1=3
+ * Not a great typesetting, but it is handy in debugging sessions.
+ */
+#define _v_(var) #var"=" << var << " "
+
 #endif
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to