* Past queueing the LogEntry, the LogChannel is done with the whole thing.
* LogClient will deal with sending and handling of LogEntries.
*/
-class LogChannel : public OstreamTemp::OstreamTempSink
+class LogChannel : public LoggerSinkSet
{
public:
const std::string &facility,
const std::string &prio);
- OstreamTemp debug() {
+ OstreamTemp debug() final {
return OstreamTemp(CLOG_DEBUG, this);
}
- void debug(std::stringstream &s) {
+ void debug(std::stringstream &s) final {
do_log(CLOG_DEBUG, s);
}
/**
ceph_abort();
}
}
- OstreamTemp info() {
+ OstreamTemp info() final {
return OstreamTemp(CLOG_INFO, this);
}
- void info(std::stringstream &s) {
+ void info(std::stringstream &s) final {
do_log(CLOG_INFO, s);
}
- OstreamTemp warn() {
+ OstreamTemp warn() final {
return OstreamTemp(CLOG_WARN, this);
}
- void warn(std::stringstream &s) {
+ void warn(std::stringstream &s) final {
do_log(CLOG_WARN, s);
}
- OstreamTemp error() {
+ OstreamTemp error() final {
return OstreamTemp(CLOG_ERROR, this);
}
- void error(std::stringstream &s) {
+ void error(std::stringstream &s) final {
do_log(CLOG_ERROR, s);
}
- OstreamTemp sec() {
+ OstreamTemp sec() final {
return OstreamTemp(CLOG_SEC, this);
}
- void sec(std::stringstream &s) {
+ void sec(std::stringstream &s) final {
do_log(CLOG_SEC, s);
}
*/
clog_targets_conf_t parse_client_options(CephContext* conf_cct);
- void do_log(clog_type prio, std::stringstream& ss);
- void do_log(clog_type prio, const std::string& s);
+ void do_log(clog_type prio, std::stringstream& ss) final;
+ void do_log(clog_type prio, const std::string& s) final;
private:
CephContext *cct;
OstreamTempSink *parent;
std::stringstream ss;
};
+
+class LoggerSinkSet : public OstreamTemp::OstreamTempSink {
+public:
+ virtual void info(std::stringstream &s) = 0;
+ virtual void warn(std::stringstream &s) = 0;
+ virtual void error(std::stringstream &s) = 0;
+ virtual void sec(std::stringstream &s) = 0;
+ virtual void debug(std::stringstream &s) = 0;
+ virtual OstreamTemp info() = 0;
+ virtual OstreamTemp warn() = 0;
+ virtual OstreamTemp error() = 0;
+ virtual OstreamTemp sec() = 0;
+ virtual OstreamTemp debug() = 0;
+ virtual void do_log(clog_type prio, std::stringstream& ss) = 0;
+ virtual void do_log(clog_type prio, const std::string& ss) = 0;
+ virtual ~LoggerSinkSet() {};
+};
* Past queueing the LogEntry, the LogChannel is done with the whole thing.
* LogClient will deal with sending and handling of LogEntries.
*/
-class LogChannel : public OstreamTemp::OstreamTempSink
+class LogChannel : public LoggerSinkSet
{
public:
LogChannel(LogClient *lc, const std::string &channel);
OstreamTemp debug() {
return OstreamTemp(CLOG_DEBUG, this);
}
- void debug(std::stringstream &s) {
+ void debug(std::stringstream &s) final {
do_log(CLOG_DEBUG, s);
}
/**
ceph_abort();
}
}
- OstreamTemp info() {
+ OstreamTemp info() final {
return OstreamTemp(CLOG_INFO, this);
}
- void info(std::stringstream &s) {
+ void info(std::stringstream &s) final {
do_log(CLOG_INFO, s);
}
- OstreamTemp warn() {
+ OstreamTemp warn() final {
return OstreamTemp(CLOG_WARN, this);
}
- void warn(std::stringstream &s) {
+ void warn(std::stringstream &s) final {
do_log(CLOG_WARN, s);
}
- OstreamTemp error() {
+ OstreamTemp error() final {
return OstreamTemp(CLOG_ERROR, this);
}
- void error(std::stringstream &s) {
+ void error(std::stringstream &s) final {
do_log(CLOG_ERROR, s);
}
- OstreamTemp sec() {
+ OstreamTemp sec() final {
return OstreamTemp(CLOG_SEC, this);
}
- void sec(std::stringstream &s) {
+ void sec(std::stringstream &s) final {
do_log(CLOG_SEC, s);
}
uuid_d &fsid,
std::string &host);
- void do_log(clog_type prio, std::stringstream& ss);
- void do_log(clog_type prio, const std::string& s);
+ void do_log(clog_type prio, std::stringstream& ss) final;
+ void do_log(clog_type prio, const std::string& s) final;
private:
LogClient *parent;