summaryrefslogtreecommitdiff
path: root/src/KM_log.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2008-07-11 06:30:14 +0000
committerjhurst <>2008-07-11 06:30:14 +0000
commit4e35856e1045d356d3fcad1b4db4e40e613847c6 (patch)
tree7a355c41268bb8b58b9a08459aa9d4bf1e91b320 /src/KM_log.cpp
parent3c9d1a2d73ae08274cb0185bc6379ca42db19c3e (diff)
added ostream for log, SAX parser improvements
Diffstat (limited to 'src/KM_log.cpp')
-rwxr-xr-xsrc/KM_log.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/KM_log.cpp b/src/KM_log.cpp
index 4778ffc..aa0303b 100755
--- a/src/KM_log.cpp
+++ b/src/KM_log.cpp
@@ -34,6 +34,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/types.h>
#include <string.h>
#include <stdarg.h>
+#include <iostream>
+#include <sstream>
#ifdef KM_WIN32
#define getpid GetCurrentProcessId
@@ -145,6 +147,24 @@ Kumu::StreamLogSink::WriteEntry(const LogEntry& Entry)
//------------------------------------------------------------------------------------------
//
+std::basic_ostream<char, std::char_traits<char> >&
+Kumu::operator<<(std::basic_ostream<char, std::char_traits<char> >& strm, LogEntry const& Entry)
+{
+ std::basic_ostringstream<char, std::char_traits<char> > s;
+ s.copyfmt(strm);
+ s.width(0);
+ std::string buf;
+
+ s << Entry.CreateStringWithOptions(buf, LOG_OPTION_ALL);
+
+ strm << s.str();
+ return strm;
+}
+
+//------------------------------------------------------------------------------------------
+
+
+//
bool
Kumu::LogEntry::TestFilter(i32_t filter) const
{