28 #ifndef Pt_System_LogChannel_h
29 #define Pt_System_LogChannel_h
31 #include <Pt/System/Api.h>
32 #include <Pt/NonCopyable.h>
74 const std::string&
url()
const
82 void open(
const std::string& urlstr)
98 void write(
const std::string& message)
99 { this->onWrite( message.data(), message.size() ); }
107 virtual void onOpen(
const std::string& url) = 0;
111 virtual void onClose() = 0;
115 virtual void onWrite(
const char* msg, std::size_t msglen) = 0;
126 #endif // Pt_System_LogChannel_h
LogChannel()
Default constructor.
Definition: LogChannel.h:56
Protects derived classes from being copied.
Definition: NonCopyable.h:54
void close()
Closes the channel.
Definition: LogChannel.h:90
void open(const std::string &urlstr)
Open the channel from URL.
Definition: LogChannel.h:82
void write(const std::string &message)
Writes data to the channel.
Definition: LogChannel.h:98
virtual ~LogChannel()
Destructor.
Definition: LogChannel.h:63
Logging channel.
Definition: LogChannel.h:51
const std::string & url() const
Returns the URL used to open the channel.
Definition: LogChannel.h:74