From 4e35856e1045d356d3fcad1b4db4e40e613847c6 Mon Sep 17 00:00:00 2001 From: jhurst Date: Fri, 11 Jul 2008 06:30:14 +0000 Subject: added ostream for log, SAX parser improvements --- src/KM_log.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/KM_log.cpp') 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 #include #include +#include +#include #ifdef KM_WIN32 #define getpid GetCurrentProcessId @@ -144,6 +146,24 @@ Kumu::StreamLogSink::WriteEntry(const LogEntry& Entry) //------------------------------------------------------------------------------------------ +// +std::basic_ostream >& +Kumu::operator<<(std::basic_ostream >& strm, LogEntry const& Entry) +{ + std::basic_ostringstream > 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 -- cgit v1.2.3