#include <Pt/System/LogChannel.h>
Logging channel. More...
Inherits NonCopyable.
Public Member Functions | |
virtual | ~LogChannel () |
Destructor. | |
void | close () |
Closes the channel. | |
void | open (const std::string &urlstr) |
Open the channel from URL. More... | |
const std::string & | url () const |
Returns the URL used to open the channel. | |
void | write (const std::string &message) |
Writes data to the channel. | |
Protected Member Functions | |
LogChannel () | |
Default constructor. | |
virtual void | onClose ()=0 |
Closes the channel. | |
virtual void | onOpen (const std::string &url)=0 |
Open the channel from URL. More... | |
virtual void | onWrite (const char *msg, std::size_t msglen)=0 |
Writes data to the channel. | |
This is the base class for all logging channels use by the logging targets in the LogManager. Channels are either loaded as a plugin or created by the LogManager on startup. Outside of the logging framework the channels are opaque and only referred to by their URL's. A channel supports synchronous and asynchronous logging, whereby the latter one usually involves a thread and a message qeueue.
void open | ( | const std::string & | urlstr | ) |
The URL is specific to the channel and may contain attributes to open it correctly.
|
protectedpure virtual |
The URL is specific to the channel and may contain attributes to open it correctly.