InspIRCd  3.0
Public Member Functions | Protected Attributes | List of all members
FileWriter Class Reference

#include <logger.h>

Public Member Functions

 FileWriter (FILE *logfile, unsigned int flushcount)
void WriteLogLine (const std::string &line)
virtual ~FileWriter ()

Protected Attributes

FILE * log
unsigned int flush
unsigned int writeops

Detailed Description

Simple wrapper providing periodic flushing to a disk-backed file.

Constructor & Destructor Documentation

◆ FileWriter()

FileWriter::FileWriter ( FILE *  logfile,
unsigned int  flushcount 

The constructor takes an already opened logfile.

◆ ~FileWriter()

FileWriter::~FileWriter ( )

Close the log file and cancel any events.

Member Function Documentation

◆ WriteLogLine()

void FileWriter::WriteLogLine ( const std::string &  line)

Write one or more preformatted log lines. If the data cannot be written immediately, this class will insert itself into the SocketEngine, and register a write event, and when the write event occurs it will attempt again to write the data.

Member Data Documentation

◆ flush

unsigned int FileWriter::flush

The number of write operations after which we should flush.

◆ log

FILE* FileWriter::log

The log file (fd is inside this somewhere, we get it out with fileno())

◆ writeops

unsigned int FileWriter::writeops

Number of write operations that have occurred

The documentation for this class was generated from the following files: