1#ifndef WIBBLE_LOG_STREAM_H
2#define WIBBLE_LOG_STREAM_H
30 virtual void send(
Level level,
const std::string& msg) = 0;
Streambuf class for logging.
Definition stream.h:35
void send()
Send the message "line" with the level "level".
Definition stream.cpp:24
Level level
Level of the next log message.
Definition stream.h:42
void setSender(Sender *s)
Set/change the sender to use for this streambuf.
Definition stream.cpp:22
Sender * sender
Sender used to send log messages.
Definition stream.h:48
virtual ~Streambuf()
Definition stream.cpp:11
void send_partial_line()
If there is a partial line, send it out.
Definition stream.cpp:16
std::string line
Line buffer with the log message we are building.
Definition stream.h:40
int overflow(int c)
override to get data as a std::streambuf
Definition stream.cpp:38
static const Level defaultLevel
Level to use for messages whose level has not been specified.
Definition stream.h:38
void setLevel(const Level &level)
Set the level for the next message, and the next message only.
Definition stream.cpp:33
Streambuf()
Construct a nonworking Streambuf to be initialised later.
Definition stream.cpp:7
std::ostream & operator<<(std::ostream &s, Level lev)
Definition stream.cpp:47
Level
Urgency of a log message.
Definition stream.h:12
@ WARN
Definition stream.h:16
@ INFO
Definition stream.h:14
@ CRIT
Definition stream.h:18
@ DEBUG
Definition stream.h:13
@ ERR
Definition stream.h:17
@ UNUSUAL
Definition stream.h:15
Handle sending a log message.
Definition stream.h:23
virtual void send(Level level, const std::string &msg)=0
Log one line of text with the given level.
virtual ~Sender()
Definition stream.h:24