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() ); }
115 virtual void onWrite(
const char* msg, std::size_t msglen) = 0;
Base class that disables copy construction and assignment.
Definition NonCopyable.h:59
virtual void onOpen(const std::string &url)=0
Open the channel from URL.
void open(const std::string &urlstr)
Open the channel from URL.
Definition LogChannel.h:82
void close()
Closes the channel.
Definition LogChannel.h:90
LogChannel()
Default constructor.
Definition LogChannel.h:56
virtual ~LogChannel()
Destructor.
Definition LogChannel.h:63
virtual void onClose()=0
Closes the channel.
virtual void onWrite(const char *msg, std::size_t msglen)=0
Writes data to the channel.
const std::string & url() const
Returns the URL used to open the channel.
Definition LogChannel.h:74
void write(const std::string &message)
Writes data to the channel.
Definition LogChannel.h:98
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33