RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <rotating_output.h>
Public Types | |
typedef std::function < LogOutput *(std::string)> | LoggerFactory |
Public Member Functions | |
RotatingOutputAdaptor (LoggerFactory factory) | |
void | open (const std::string &filenamePattern, const std::string &periodPattern) |
virtual void | logMessage (const std::string &channel, const std::string &message) |
virtual Json::Value | stats () const |
virtual void | clearStats () |
virtual void | close () |
Public Attributes | |
boost::function< void(std::string)> | onPreFileOpen |
boost::function< void(std::string)> | onPostFileOpen |
boost::function< void(std::string)> | onPreFileClose |
boost::function< void(std::string)> | onPostFileClose |
boost::function< void(std::string, std::size_t)> | onFileWrite |
boost::function< void(std::string, std::string)> | onBeforeLogRotation |
boost::function< void(std::string, std::string)> | onAfterLogRotation |
A rotating output that writes its output to a given logger.
Definition at line 89 of file rotating_output.h.
void Datacratic::RotatingOutputAdaptor::clearStats | ( | ) | [virtual] |
Clears the current value of stats. Default implementation does nothing.
Reimplemented from Datacratic::LogOutput.
Definition at line 168 of file rotating_output.cc.
void Datacratic::RotatingOutputAdaptor::close | ( | ) | [virtual] |
Should close whatever resources are being used by the output and join any threads that it's created.
Reimplemented from Datacratic::RotatingOutput.
Definition at line 143 of file rotating_output.cc.
void Datacratic::RotatingOutputAdaptor::logMessage | ( | const std::string & | channel, |
const std::string & | message | ||
) | [virtual] |
This is the method that will be called whenever we need to log a message to something.
Implements Datacratic::LogOutput.
Definition at line 150 of file rotating_output.cc.
void Datacratic::RotatingOutputAdaptor::open | ( | const std::string & | filenamePattern, |
const std::string & | periodPattern | ||
) |
Open the file for rotation.
Definition at line 132 of file rotating_output.cc.
Json::Value Datacratic::RotatingOutputAdaptor::stats | ( | ) | const [virtual] |
Should return a JSON object containing whatever stats have been accumulated since last time clearStats() was called.
Default returns an empty JSON object.
Reimplemented from Datacratic::LogOutput.
Definition at line 160 of file rotating_output.cc.
boost::function<void (std::string, std::string)> Datacratic::RotatingOutputAdaptor::onBeforeLogRotation |
Function to be called before and after a log rotation occurs.
Definition at line 118 of file rotating_output.h.