filters.h
Go to the documentation of this file.
#ifndef WIBBLE_LOG_FILTERS_H
#define WIBBLE_LOG_FILTERS_H
#include <wibble/log/stream.h>
#include <vector>
namespace wibble {
namespace log {
struct Timestamper : public Sender
{
Sender* next;
std::string fmt;
Timestamper(Sender* next = 0, const std::string& fmt = "%b %e %T ");
virtual ~Timestamper();
virtual void send(Level level, const std::string& msg);
};
struct LevelFilter : public log::Sender
{
Sender* next;
log::Level minLevel;
LevelFilter(Sender* next = 0, log::Level minLevel = log::INFO);
virtual ~LevelFilter();
virtual void send(log::Level level, const std::string& msg);
};
struct Tee : public log::Sender
{
std::vector<Sender*> next;
Tee();
// Shortcut to initialise with two streams
Tee(Sender* first, Sender* second);
~Tee();
virtual void send(log::Level level, const std::string& msg);
};
}
}
// vim:set ts=4 sw=4:
#endif
wibble::log::Level
Level
Urgency of a log message.
Definition: stream.h:11
wibble::log::Timestamper
Prepend timestamps to log lines.
Definition: filters.h:19
wibble::log::INFO
Definition: stream.h:14
wibble::log::LevelFilter::minLevel
log::Level minLevel
Definition: filters.h:36
wibble::log::LevelFilter::~LevelFilter
virtual ~LevelFilter()
Definition: filters.cpp:64
stream.h
wibble::log::Timestamper::fmt
std::string fmt
Definition: filters.h:22
wibble::log::Tee::~Tee
~Tee()
Definition: filters.cpp:80
wibble::log::Tee::next
std::vector< Sender * > next
Definition: filters.h:49
wibble::log::Timestamper::Timestamper
Timestamper(Sender *next=0, const std::string &fmt="%b %e %T ")
Definition: filters.cpp:17
wibble::log::Tee
Send the same message to multiple streams.
Definition: filters.h:47
wibble::log::Sender
Handle sending a log message.
Definition: stream.h:22
wibble::log::LevelFilter::LevelFilter
LevelFilter(Sender *next=0, log::Level minLevel=log::INFO)
Definition: filters.cpp:59
wibble
Definition: amorph.h:17
wibble::log::LevelFilter
Log only messages whose level is >= minLevel.
Definition: filters.h:33
wibble::log::Tee::Tee
Tee()
Definition: filters.cpp:74
wibble::log::Timestamper::next
Sender * next
Definition: filters.h:21
wibble::log::Timestamper::~Timestamper
virtual ~Timestamper()
Definition: filters.cpp:22
wibble::log::Timestamper::send
virtual void send(Level level, const std::string &msg)
Log one line of text with the given level.
Definition: filters.cpp:26
wibble::log::LevelFilter::next
Sender * next
Definition: filters.h:35
wibble::log::LevelFilter::send
virtual void send(log::Level level, const std::string &msg)
Log one line of text with the given level.
Definition: filters.cpp:68
wibble::log::Tee::send
virtual void send(log::Level level, const std::string &msg)
Log one line of text with the given level.
Definition: filters.cpp:84