Collaboration diagram for DebugModule:

Public Member Functions

 DebugModule ()
 ~DebugModule ()=delete
void prepareToDie ()
void log (const DebugMessageHeader &, const CompiledDebugMessageBody &)
void useCacheLog ()
void banCacheLogUse ()

Public Attributes

CacheLogChannel cacheLogChannel
StderrChannel stderrChannel
SyslogChannel syslogChannel

Detailed Description

Manages private module state that must be available during program startup and (especially) termination. Any non-trivial state objects must be encapsulated here because debugs() may be called before dynamic initialization or after the destruction of static objects in

Definition at line 295 of file

Constructor & Destructor Documentation

◆ DebugModule()

DebugModule::DebugModule ( )

Definition at line 434 of file

References DidResetSections, Debug::PrepareToDie(), and ResetSections().

◆ ~DebugModule()

DebugModule::~DebugModule ( )

Member Function Documentation

◆ banCacheLogUse()

void DebugModule::banCacheLogUse ( )

Start using stderr as the primary debugs() destination. Stop waiting for an open cache_log file (if we were doing that).

Definition at line 491 of file

References assert, cacheLogChannel, DebugFile::file(), stderrChannel, StderrChannel::takeOver(), and TheLog.

Referenced by Debug::BanCacheLogUse(), debugOpenLog(), prepareToDie(), and Debug::StopCacheLogUse().

◆ log()

void DebugModule::log ( const DebugMessageHeader header,
const CompiledDebugMessageBody body 

Log the given debugs() message to appropriate channel(s) (eventually). Assumes the message has passed the global section/level filter.

Definition at line 446 of file

References cacheLogChannel, DebugChannel::log(), stderrChannel, and syslogChannel.

Referenced by Debug::LogMessage().

◆ prepareToDie()

void DebugModule::prepareToDie ( )

Reacts to ongoing program termination (e.g., flushes buffered messages). Call this before logging the termination reason to maximize the chances of that valuable debugs() getting through to the admin.

Definition at line 454 of file

References banCacheLogUse(), cacheLogChannel, DebugChannel::collectingEarlyMessages(), DebugFile::file(), Debug::LogWaitingForIdle(), stderrChannel, DebugChannel::stopEarlyMessageCollection(), syslogChannel, and TheLog.

Referenced by Debug::PrepareToDie().

◆ useCacheLog()

void DebugModule::useCacheLog ( )

Start using an open cache_log file as the primary debugs() destination. Stop using stderr as a cache_log replacement (if we were doing that).

Definition at line 483 of file

References assert, cacheLogChannel, DebugFile::file(), stderrChannel, StderrChannel::stopCoveringForCacheLog(), DebugChannel::stopEarlyMessageCollection(), and TheLog.

Referenced by debugOpenLog().

Member Data Documentation

◆ cacheLogChannel

CacheLogChannel DebugModule::cacheLogChannel

Definition at line 319 of file

Referenced by banCacheLogUse(), log(), prepareToDie(), Debug::StopCacheLogUse(), and useCacheLog().

◆ stderrChannel

StderrChannel DebugModule::stderrChannel

◆ syslogChannel

SyslogChannel DebugModule::syslogChannel

Definition at line 321 of file

Referenced by log(), prepareToDie(), and Debug::SettleSyslog().

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






Web Site Translations