diff options
Diffstat (limited to 'src/KM_log.cpp')
| -rwxr-xr-x | src/KM_log.cpp | 20 |
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 { |
