aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/src/Log.cpp
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-09-30 15:30:53 +0200
committerMihai Moldovan <ionic@ionic.de>2017-10-27 08:46:39 +0200
commit09586d760833dac680ba8837b0b695ed3900c96d (patch)
treec97dfa775e4bdb4acdd4511c9455a8362235a8d8 /nxcomp/src/Log.cpp
parentfc4a18d3398ec360b28802dff990e2c1c8d368b5 (diff)
downloadnx-libs-09586d760833dac680ba8837b0b695ed3900c96d.tar.gz
nx-libs-09586d760833dac680ba8837b0b695ed3900c96d.tar.bz2
nx-libs-09586d760833dac680ba8837b0b695ed3900c96d.zip
nxcomp/src/Log.{cpp,h}: port to std::stack as internal buffer structure.
This has one drawback: after flushing log data to its underlying output, a new NXLogStamp object MUST be written to the NXLog object in order to create a new entry within the stack. This can be changed if necessary. For now I'd like to keep it as-is.
Diffstat (limited to 'nxcomp/src/Log.cpp')
-rw-r--r--nxcomp/src/Log.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/nxcomp/src/Log.cpp b/nxcomp/src/Log.cpp
index 66ae1bd78..83e11b98a 100644
--- a/nxcomp/src/Log.cpp
+++ b/nxcomp/src/Log.cpp
@@ -109,14 +109,12 @@ 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, we flush it to finalize the previous
- // log entry.
+ // If there's any content in the buffer, create a new entry in the output
+ // queue.
if ( out.synchronized() )
- out.flush();
-
+ out.new_stack_entry();
out << out.stamp_to_string(value);
return out;
}
-