RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Public Attributes
Datacratic::RotatingOutputAdaptor Struct Reference

#include <rotating_output.h>

Inheritance diagram for Datacratic::RotatingOutputAdaptor:
Datacratic::RotatingOutput Datacratic::LogOutput Datacratic::RotatingCloudOutput Datacratic::RotatingFileOutput

List of all members.

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

Detailed Description

A rotating output that writes its output to a given logger.

Definition at line 89 of file rotating_output.h.


Member Function Documentation

Clears the current value of stats. Default implementation does nothing.

Reimplemented from Datacratic::LogOutput.

Definition at line 168 of file rotating_output.cc.

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.

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.


Member Data Documentation

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.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator