|
LRAUV
revA
|
LogEntry with information specific to "Syslog"-like text logs. More...
#include <SyslogEntry.h>


Classes | |
| class | StaticDestructor |
| Makes sure that mallocRing_s is deleted on shutdown. More... | |
Public Member Functions | |
| SyslogEntry (const Str &inMsg, Syslog::Severity sev, const CodedStr &loggerFacility, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | |
| Constructor, initialized from a Str. More... | |
| SyslogEntry (const SyslogEntry &syslogEntry) | |
| Copy Constructor. More... | |
| virtual | ~SyslogEntry () |
| Destructor. More... | |
| void * | operator new (size_t size) |
| Override new. More... | |
| void | operator delete (void *p) |
| Override delete. More... | |
| virtual unsigned int | write (Timestamp &timeBase, OutStream &logStream) const |
| Send payload to a stream. More... | |
| virtual Str | toString (const Unit *unit=NULL) const |
| Convert payload to Str. More... | |
| virtual Str | toKmlString (const Unit *unit=NULL) const |
| Return Str. More... | |
| const Str & | getMessage (void) const |
| Get the message. More... | |
| Syslog::Severity | getSeverity (void) const |
| Return the severity. More... | |
| const CodedStr & | getLoggerFacility (void) const |
Public Member Functions inherited from LogEntry | |
| virtual | ~LogEntry () |
| Destructor. More... | |
| const Timestamp & | getTimestamp (void) const |
| Accessors. More... | |
| const Timestamp & | setTimestamp (const Timestamp &newTime) |
| const Timestamp & | setTimestamp (const double newTime) |
| Type | getType (void) const |
Static Public Member Functions | |
| static SyslogEntry * | Read (Timestamp &timeBase, Timespan &timeAdjust, InStream &inStream, unsigned short firstWord, Logger &logger) |
| Read new SyslogEntry from a stream. More... | |
Static Public Member Functions inherited from LogEntry | |
| static LogEntry * | Read (Timestamp &timeBase, Timespan &timeAdjust, InStream &inStream, Logger &logger) |
| Read in a new entry from a stream. More... | |
| static const char * | TypeToString (Type theType) |
| Convert types to Strs. More... | |
Private Attributes | |
| Str | message_ |
| The stored freetext message. More... | |
| Syslog::Severity | severity_ |
| const CodedStr & | loggerFacility_ |
Static Private Attributes | |
| static RingBufferVoid * | MallocRing_ |
| Declared as a pointer to avoid including RingBuffer.h header here. More... | |
| static SyslogEntry::StaticDestructor | StaticDestructor_ |
| Static instance of StaticDestructor. More... | |
Additional Inherited Members | |
Public Types inherited from LogEntry | |
| enum | Type { NOT_LOG_ENTRY = -1, EVENT_LOG_ENTRY = 0, DIRECTORY_LOG_ENTRY = 1, DATA_LOG_ENTRY = 2, SYSLOG_LOG_ENTRY = 3 } |
| Defines an enum for "typing" the various LogEntries. More... | |
Static Public Attributes inherited from LogEntry | |
| static const int | TYPE_MASK = 0x0003 |
Protected Member Functions inherited from LogEntry | |
| LogEntry (Type myType, const Timestamp ×tamp=Timestamp::NOT_SET_TIME) | |
| Constructor. More... | |
| unsigned int | writeTimestamp (const Timestamp &timeBase, bool changed, OutStream &logStream, Logger::TimePrecisionType timePrecision) const |
Static Protected Member Functions inherited from LogEntry | |
| static bool | ReadTimestamp (Timestamp ×tamp, bool &changed, InStream &inStream, Logger &logger, Logger::TimePrecisionType timePrecision) |
Protected Attributes inherited from LogEntry | |
| Type | type_ |
| Stores the type of a given LogEntry. More... | |
| Timestamp | timestamp_ |
Static Protected Attributes inherited from LogEntry | |
| static const Str | UNKNOWN |
LogEntry with information specific to "Syslog"-like text logs.
A Syslog::Severity value is associated with each text entry, indicating its importance. Severities include:
A SyslogEntry is serialized as:
| SyslogEntry::SyslogEntry | ( | const Str & | inMsg, |
| Syslog::Severity | sev, | ||
| const CodedStr & | loggerFacility, | ||
| const Timestamp & | timestamp = Timestamp::NOT_SET_TIME |
||
| ) |
| SyslogEntry::SyslogEntry | ( | const SyslogEntry & | syslogEntry | ) |
Copy Constructor.
|
virtual |
Destructor.
|
inline |
|
inline |
Get the message.
References message_.
Referenced by SyslogStartRule::check(), MostRecentLogWriter::write(), and write().
|
inline |
Return the severity.
References severity_.
Referenced by SyslogSeverityRule::check(), Logger::log(), and MostRecentLogWriter::write().
| void SyslogEntry::operator delete | ( | void * | p | ) |
Override delete.
| void * SyslogEntry::operator new | ( | size_t | size | ) |
Override new.
|
static |
Read new SyslogEntry from a stream.
Implements requirement: Time values must be stored to at least millisecond resolution, with the option for less resolution.
References InStream::bytesRead(), InStream::eof(), Syslog::ERROR, Slate::GetName(), Timespan::INVALID_TIMESPAN, InStream::read(), LogEntry::ReadTimestamp(), InStream::readUShortCompact(), LogEntry::setTimestamp(), Syslog::SEVERITY_MASK, Logger::syslog(), SyslogEntry(), and Logger::TIME_PRECISION_MILLIS.
Referenced by LogEntry::Read().
Return Str.
References loggerFacility_, message_, LogEntry::timestamp_, and Timestamp::toSmallString().
Convert payload to Str.
Implements LogEntry.
References Timestamp::asDouble(), loggerFacility_, message_, Syslog::NONE, severity_, Syslog::SeverityToString(), LogEntry::timestamp_, and Timestamp::toString().
Send payload to a stream.
Implements requirement: Time values must be stored to at least millisecond resolution, with the option for less resolution.
Implements LogEntry.
References OutStream::bytesWritten(), Str::data(), CodedStr::getCode(), getMessage(), Str::length(), loggerFacility_, MIN, Syslog::NONE, severity_, LogEntry::SYSLOG_LOG_ENTRY, Logger::TIME_PRECISION_MILLIS, UINT16_MAX, OutStream::write(), LogEntry::writeTimestamp(), and OutStream::writeUShortCompact().
|
private |
Referenced by getLoggerFacility(), toKmlString(), toString(), and write().
|
staticprivate |
Declared as a pointer to avoid including RingBuffer.h header here.
Referenced by SyslogEntry::StaticDestructor::~StaticDestructor().
|
private |
The stored freetext message.
Referenced by getMessage(), toKmlString(), and toString().
|
private |
Referenced by getSeverity(), toString(), and write().
|
staticprivate |
Static instance of StaticDestructor.