syslog DebugChannel More...

Inheritance diagram for SyslogChannel:
Collaboration diagram for SyslogChannel:

Public Types

using EarlyMessages = std::unique_ptr< CompiledDebugMessages >
 

Public Member Functions

 SyslogChannel ()
 
void markOpened ()
 
bool collectingEarlyMessages () const
 whether we are still expecting (and buffering) early messages More...
 
void stopEarlyMessageCollection ()
 end early message buffering, logging any saved messages More...
 
EarlyMessages releaseEarlyMessages ()
 
void log (const DebugMessageHeader &, const CompiledDebugMessageBody &)
 

Protected Member Functions

virtual bool shouldWrite (const DebugMessageHeader &) const final
 
virtual void write (const DebugMessageHeader &, const CompiledDebugMessageBody &) final
 write the corresponding debugs() message into the channel More...
 
void saveMessage (const DebugMessageHeader &, const CompiledDebugMessageBody &)
 stores the given early message (if possible) or forgets it (otherwise) More...
 
void writeToStream (FILE &, const DebugMessageHeader &, const CompiledDebugMessageBody &)
 Formats a validated debugs() record and writes it to the given FILE. More...
 
void noteWritten (const DebugMessageHeader &)
 reacts to a written a debugs() message More...
 

Static Protected Member Functions

static void StopSavingAndLog (DebugChannel &, DebugChannel *=nullptr)
 stop saving and log() any "early" messages, in recordNumber order More...
 

Protected Attributes

const char *const name = nullptr
 unique channel label for debugging More...
 
DebugRecordCount written = 0
 the number of messages sent to the underlying channel so far More...
 
DebugRecordCount lastWrittenRecordNumber = 0
 DebugMessageHeader::recordNumber of the last message we wrote. More...
 
EarlyMessages earlyMessages
 

Private Attributes

bool opened = false
 whether openlog() was called More...
 

Detailed Description

Definition at line 274 of file debug.cc.

Member Typedef Documentation

◆ EarlyMessages

using DebugChannel::EarlyMessages = std::unique_ptr<CompiledDebugMessages>
inherited

Definition at line 149 of file debug.cc.

Constructor & Destructor Documentation

◆ SyslogChannel()

SyslogChannel::SyslogChannel ( )
inline

Definition at line 277 of file debug.cc.

Member Function Documentation

◆ collectingEarlyMessages()

bool DebugChannel::collectingEarlyMessages ( ) const
inlineinherited

Definition at line 158 of file debug.cc.

References DebugChannel::earlyMessages.

Referenced by DebugModule::prepareToDie().

◆ log()

void DebugChannel::log ( const DebugMessageHeader header,
const CompiledDebugMessageBody body 
)
inherited

Write the message to the channel if the channel accepts (such) messages. This writing may be delayed until the channel configuration is settled.

Definition at line 535 of file debug.cc.

References DebugChannel::lastWrittenRecordNumber, DebugMessageHeader::recordNumber, DebugChannel::saveMessage(), DebugChannel::shouldWrite(), DebugChannel::stopEarlyMessageCollection(), and DebugChannel::write().

Referenced by DebugModule::log().

◆ markOpened()

void SyslogChannel::markOpened ( )
inline

Definition at line 279 of file debug.cc.

References opened.

Referenced by Debug::SettleSyslog().

◆ noteWritten()

void DebugChannel::noteWritten ( const DebugMessageHeader header)
protectedinherited

◆ releaseEarlyMessages()

EarlyMessages DebugChannel::releaseEarlyMessages ( )
inlineinherited

end early message buffering, without logging any saved messages

Returns
(a possibly empty container with) saved messages or nil

Definition at line 165 of file debug.cc.

References DebugChannel::earlyMessages.

Referenced by DebugChannel::StopSavingAndLog().

◆ saveMessage()

void DebugChannel::saveMessage ( const DebugMessageHeader header,
const CompiledDebugMessageBody body 
)
protectedinherited

◆ shouldWrite()

bool SyslogChannel::shouldWrite ( const DebugMessageHeader ) const
finalprotectedvirtual

whether we should write() the corresponding debugs() message now (assumes some higher-level code applied cache.log section/level filter)

Implements DebugChannel.

Definition at line 1068 of file debug.cc.

References assert, DBG_IMPORTANT, DebugMessageHeader::forceAlert, DebugMessageHeader::level, Debug::log_syslog, and opened.

◆ stopEarlyMessageCollection()

void DebugChannel::stopEarlyMessageCollection ( )
inherited

◆ StopSavingAndLog()

void DebugChannel::StopSavingAndLog ( DebugChannel channelA,
DebugChannel channelBOrNil = nullptr 
)
staticprotectedinherited

◆ write()

void SyslogChannel::write ( const DebugMessageHeader ,
const CompiledDebugMessageBody  
)
finalprotectedvirtual

Implements DebugChannel.

Definition at line 1060 of file debug.cc.

References assert.

◆ writeToStream()

void DebugChannel::writeToStream ( FILE &  destination,
const DebugMessageHeader header,
const CompiledDebugMessageBody body 
)
protectedinherited

Member Data Documentation

◆ earlyMessages

EarlyMessages DebugChannel::earlyMessages
protectedinherited

debugs() messages waiting for the channel configuration to settle (and the channel to open) so that their eligibility for logging can be determined (and the messages can be actually written somewhere)

Definition at line 233 of file debug.cc.

Referenced by DebugChannel::collectingEarlyMessages(), DebugChannel::releaseEarlyMessages(), DebugChannel::saveMessage(), and DebugChannel::stopEarlyMessageCollection().

◆ lastWrittenRecordNumber

DebugRecordCount DebugChannel::lastWrittenRecordNumber = 0
protectedinherited

Definition at line 228 of file debug.cc.

Referenced by DebugChannel::log(), and DebugChannel::noteWritten().

◆ name

const char* const DebugChannel::name = nullptr
protectedinherited

Definition at line 222 of file debug.cc.

Referenced by DebugChannel::StopSavingAndLog().

◆ opened

bool SyslogChannel::opened = false
private

Definition at line 287 of file debug.cc.

Referenced by markOpened(), and shouldWrite().

◆ written

DebugRecordCount DebugChannel::written = 0
protectedinherited

Definition at line 225 of file debug.cc.

Referenced by DebugChannel::noteWritten(), and DebugChannel::StopSavingAndLog().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors