// file : cult/trace/stream.hxx // author : Boris Kolpackov // copyright : Copyright (c) 2005-2010 Boris Kolpackov // license : GNU GPL v2 + exceptions; see accompanying LICENSE file #ifndef CULT_TRACE_STREAM_HXX #define CULT_TRACE_STREAM_HXX #include #include #include namespace Cult { namespace Trace { class Stream: public NonCopyable { public: Stream (Char const* id, Int level, Log& l = Log::instance ()); public: Char const* id () const; Int level () const; public: Stream& operator<< (Record const& r); private: struct Mediator { ~Mediator (); Mediator (Stream&); Stream& s_; Record r_; }; friend Record& operator<< (Mediator const&, Int level); friend Record& operator<< (Mediator const&, Char const* s); template friend Record& operator<< (Mediator const&, T const& arg); private: Char const* id_; Int level_; Log& log_; }; } } #ifndef CULT_TRACE_NULL #include #include #else #include #include #endif #endif // CULT_TRACE_STREAM_HXX