From 55782a0bf61d86e4729210e8eae7faf36c29e1ef Mon Sep 17 00:00:00 2001
From: Martin Beseda <martin.beseda@vsb.cz>
Date: Wed, 9 Jan 2019 16:32:12 +0100
Subject: [PATCH] NEW: Created macro WRITE_TO_OFS_DEBUG in message.h

---
 src/message.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/message.h b/src/message.h
index 28af017c..e0cd6f46 100644
--- a/src/message.h
+++ b/src/message.h
@@ -11,8 +11,13 @@
 
 #ifdef L4N_DEBUG
 #define COUT_DEBUG(inp) assert(std::cerr << std::flush << "DEBUG: " << inp << std::flush)
+
+#define WRITE_TO_OFS_DEBUG(ofs, msg) { if(ofs && ofs->is_open())\
+                                           *ofs << "DEBUG: " << msg;\
+                                     }
 #else
 #define COUT_DEBUG(inp)
+#define WRITE_TO_OFS_DEBUG(ofs, msg)
 #endif // L4N_DEBUG
 
 #endif //PROJECT_MESSAGE_H
-- 
GitLab