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

#include <multi_output.h>

Inheritance diagram for Datacratic::MultiOutput:
Datacratic::LogOutput

List of all members.

Classes

struct  ChannelEntry

Public Types

typedef std::function
< std::shared_ptr< LogOutput >
std::string)> 
CreateLogger

Public Member Functions

virtual void logMessage (const std::string &channel, const std::string &message)
virtual void close ()
void logTo (const std::string &channel, const std::string &pattern, const CreateLogger &createLogger)
virtual Json::Value stats () const
virtual void clearStats ()

Detailed Description

Class that writes its output to multiple places.

Definition at line 26 of file multi_output.h.


Member Typedef Documentation

typedef std::function<std::shared_ptr<LogOutput>std::string)> Datacratic::MultiOutput::CreateLogger

Function that creates a logger from a given timestamp.

Definition at line 28 of file multi_output.h.


Member Function Documentation

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

Reimplemented from Datacratic::LogOutput.

Definition at line 208 of file multi_output.cc.

void Datacratic::MultiOutput::close ( ) [virtual]

Should close whatever resources are being used by the output and join any threads that it's created.

Implements Datacratic::LogOutput.

Definition at line 194 of file multi_output.cc.

void Datacratic::MultiOutput::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 142 of file multi_output.cc.

void Datacratic::MultiOutput::logTo ( const std::string &  channel,
const std::string &  pattern,
const CreateLogger createLogger 
)

Set up the output class to log messages of the given type to files with the given pattern.

channel - the channel that will be matched by this rule. If the field is the empty string, then the rule will match any non-matching channels. pattern - The pattern to decide which file it should be logged to. It understands %(0), %(1), ... %(nnnnn) to mean field nnnnn from the message (where %(0) is the channel). createLogger - The function to be called to create a subordinate logger for the given filename.

Definition at line 180 of file multi_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 201 of file multi_output.cc.


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