X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fstream.h;h=0124b9d256d0242f2c9fb6038771b2c19e18ad22;hb=2eb14a59f3626073017de925929dcc7e3e9eb43d;hp=081c2bf04ef26685677d58af17a448f95071025d;hpb=73e1288b648b5394239e0cefd2251fedfa9727af;p=awesomized%2Flibmemcached diff --git a/libtest/stream.h b/libtest/stream.h index 081c2bf0..0124b9d2 100644 --- a/libtest/stream.h +++ b/libtest/stream.h @@ -111,6 +111,37 @@ template } }; +template + class channelfl { + private: + + public: + typedef std::basic_ostringstream stream_buffer; + + public: + void operator()(const stream_buffer& s, std::ostream& _out, + const char* filename, int line_number, const char* func) + { + if (filename) + { + _out + << filename + << ":" + << line_number + << ": in " + << func << "() " + << s.str() + << std::flush; + } + else + { + _out + << s.str() + << std::flush; + } + } + }; + template