class RNET::LogEntry

This class defines a log entry. More...

#include <RNETLog.h>

Inherits: Object.

Public functions:

LogEntry ( RNET::LogEvent iEventType, const RED::String & iComment = "" )
LogEntry ( const RED::String & iString )
~LogEntry ( )
RED::StringToString ( ) const

Public variables:

RED::String_event_comment
RNET::LogEvent_event_type
RNET::Address_host_address
struct tm_time

Detailed description:

This class defines a log entry.

REDnet can log network events. Each log entry encodes various information about the event (network address, type, date, user-defined event comment).

The date of a log entry is the one of the machine with local time zone correction applied to and follows the ANSI definition of struct tm.

The log entry is output as:

[host IP];[Event date];[Event type];[Event comment]

where:

When logging is enabled (through RNET::System::EnableLog), log entries are output either to a file or to a user-defined callback.

Functions documentation

public RNET::LogEntry::LogEntry(RNET::LogEventiEventType,
const RED::String &iComment = ""
)

Constructor.

The entry sets itself the date at which it's created.

Parameters:

iEventTypetype of the logged event.
iCommentoptional user comment to be added to the log entry.
public RNET::LogEntry::LogEntry(const RED::String &iString)

Constructor.

Build back a log entry from its string version.

The string version of a log entry can be built by calling RNET::LogEntry::ToString().

If the supplied string is not a valid log entry the resulting object may be undefined.

Parameters:

iStringstring version of a log entry.

Destructor.

Formats the log entry content to a string.

See RNET::System::EnableLog for details about the string format.

A carrier return char is appended at the end of the returned string.

Returns:

the log entry formatted to a string ready to output to a log file.

Variables documentation

optional user comment about the event.

type of the event.

network address of the host.

public struct tm RNET::LogEntry::_time

the time of the log entry.