+template<class Ch, class Tr, class A>
+ class channelfl {
+ private:
+
+ public:
+ typedef std::basic_ostringstream<Ch, Tr, A> 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;
+ }
+ }
+ };
+