From 3731a996dce9adf1c6f398cc1cdec2909588a7ee Mon Sep 17 00:00:00 2001
From: Mihai Moldovan <ionic@ionic.de>
Date: Mon, 11 Dec 2017 13:38:59 +0100
Subject: nxcomp/src/Log.cpp: only create a new queue entry if we actually
 intend to write it out later.

Fixes: ArcticaProject/nx-libs#596
---
 nxcomp/src/Log.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'nxcomp/src')

diff --git a/nxcomp/src/Log.cpp b/nxcomp/src/Log.cpp
index 951c10a04..24f660507 100644
--- a/nxcomp/src/Log.cpp
+++ b/nxcomp/src/Log.cpp
@@ -110,9 +110,9 @@ NXLog& operator<< (NXLog& out, const NXLogStamp& value)
     out.current_file( value.file() );
 
     // Writing an NXLogStamp to the stream indicates the start of a new entry.
-    // If there's any content in the buffer, create a new entry in the output
-    // queue.
-    if ( out.synchronized() )
+    // If there's any content in the buffer and we actually intend to keep that line,
+    // create a new entry in the output queue.
+    if ( out.synchronized() && out.will_log() )
         out.new_stack_entry();
 
     out << out.stamp_to_string(value);
-- 
cgit v1.2.3