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

#include <file_output.h>

Inheritance diagram for Datacratic::NamedOutput:
Datacratic::CompressingOutput Datacratic::WorkerThreadOutput Datacratic::LogOutput Datacratic::CloudOutput Datacratic::FileOutput

List of all members.

Public Member Functions

 NamedOutput (size_t ringBufferSize=65536)
virtual void open (const std::string &filename, const std::string &compression="", int level=-1)
void rotate (const std::string &newFilename, const std::string &newCompression="", int newLevel=-1)
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

Protected Member Functions

virtual std::shared_ptr< SinkcreateSink (const std::string &filename, bool append)=0
void switchFile (const std::string &filename, const std::string &compression, int level)
void closeFile ()

Detailed Description

Class that logs messages into a file, optionally gzipped or otherwise compressed.

The file writing is provided in another thread to avoid the entire logger getting bogged down if a disk can't keep up.

Definition at line 31 of file file_output.h.


Member Function Documentation

void Datacratic::NamedOutput::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 83 of file file_output.cc.

void Datacratic::NamedOutput::rotate ( const std::string &  newFilename,
const std::string &  newCompression = "",
int  newLevel = -1 
)

Rotate the log file, finishing off writing the old one and then moving everything into the new one.

This is an asynchronous operation. It will return straight away.

Definition at line 69 of file file_output.cc.


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