Class LogServer.

Inherits Connection

The LogServer listens for log items on a TCP socket and commits them to file.

Each logged item belongs to a transaction (a base-36 number), has a level of seriousness (debug, info, error or disaster) and a text.

LogServer::LogServer( int s )

Constructs an empty LogServer, listening on socket s.


Constructs a LogServer which listens nowhere. This can effectively only be used by SelfLogger.

Reimplements Connection::Connection().

void LogServer::output( EString tag, Log::Severity s, const EString & line )

This private function actually writes line to the log file with the tag and severity s converted into their textual representations.

void LogServer::parse()

Parses log messages from the input buffer.

void LogServer::processLine( const EString & line )

Adds a single line to the log output.

The line must consist of a client identifier (numbers and slashes) followed by a space, the (ignored) message facility, a slash and a severity, followed by a space and the log message.

static void LogServer::reopen( int unused )

Logs a final line in the logfile and reopens it. The unused int argument exists because this function is used as a signal handler.

static void LogServer::setLogFile( const EString & name, const EString & mode )

Tells all LogServer object to write log information to name from now on. (If the file has to be created, mode is used.)

static void LogServer::setLogLevel( const EString & l )

Sets the log level to the Severity corresponding to l.

static Log::Severity LogServer::severity( const EString & l )

Maps l to the corresponding Log::Severity value, and returns Log::Info in case of error.

This function is the inverse of Log::severity().

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.