InspIRCd  4.0
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
LogStream Class Referenceabstract

#include <logger.h>

Inheritance diagram for LogStream:
Cullable insp::uncopiable FileLogStream

Public Member Functions

 LogStream (LogLevel loglevel)
 
void ChangeLevel (LogLevel lvl)
 
virtual void OnLog (LogLevel loglevel, const std::string &type, const std::string &msg)=0
 
- Public Member Functions inherited from Cullable
virtual ~Cullable ()
 
virtual Result Cull ()
 

Static Public Attributes

static const char LogHeader []
 

Protected Attributes

LogLevel loglvl
 

Additional Inherited Members

- Protected Member Functions inherited from Cullable
 Cullable ()
 

Detailed Description

LogStream base class. Modules (and other stuff) inherit from this to decide what logging they are interested in, and what to do with it.

Member Function Documentation

◆ ChangeLevel()

void LogStream::ChangeLevel ( LogLevel  lvl)
inline

Changes the loglevel for this LogStream on-the-fly. This is needed for -nofork. But other LogStreams could use it to change loglevels.

◆ OnLog()

virtual void LogStream::OnLog ( LogLevel  loglevel,
const std::string &  type,
const std::string &  msg 
)
pure virtual

Called when there is stuff to log for this particular logstream. The derived class may take no action with it, or do what it wants with the output, basically. loglevel and type are primarily for informational purposes (the level and type of the event triggered) and msg is, of course, the actual message to log.

Implemented in FileLogStream.

Member Data Documentation

◆ LogHeader

const char LogStream::LogHeader
static
Initial value:
=
"Log started for " INSPIRCD_VERSION

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