|
Squid Web Cache master
|
DebugChannel managing messages destined for "standard error stream" (stderr) More...
Public Types | |
| using | EarlyMessages = std::unique_ptr< CompiledDebugMessages > |
Public Member Functions | |
| StderrChannel () | |
| void | takeOver (CacheLogChannel &) |
| start to take care of past/saved and future cacheLovirtual gChannel messages | |
| void | stopCoveringForCacheLog () |
| stop providing a cache_log replacement (if we were providing it) | |
| bool | enabled (const int messageDebugLevel) const |
| bool | collectingEarlyMessages () const |
| whether we are still expecting (and buffering) early messages | |
| void | stopEarlyMessageCollection () |
| end early message buffering, logging any saved messages | |
| EarlyMessages | releaseEarlyMessages () |
| void | log (const DebugMessageHeader &, const CompiledDebugMessageBody &) |
Protected Member Functions | |
| bool | shouldWrite (const DebugMessageHeader &) const final |
| void | write (const DebugMessageHeader &, const CompiledDebugMessageBody &) final |
| write the corresponding debugs() message into the channel | |
| void | saveMessage (const DebugMessageHeader &, const CompiledDebugMessageBody &) |
| stores the given early message (if possible) or forgets it (otherwise) | |
| void | writeToStream (FILE &, const DebugMessageHeader &, const CompiledDebugMessageBody &) |
| Formats a validated debugs() record and writes it to the given FILE. | |
| void | noteWritten (const DebugMessageHeader &) |
| reacts to a written a debugs() message | |
Static Protected Member Functions | |
| static void | StopSavingAndLog (DebugChannel &, DebugChannel *=nullptr) |
| stop saving and log() any "early" messages, in recordNumber order | |
Protected Attributes | |
| const char *const | name = nullptr |
| unique channel label for debugging | |
| DebugRecordCount | written = 0 |
| the number of messages sent to the underlying channel so far | |
| DebugRecordCount | lastWrittenRecordNumber = 0 |
| DebugMessageHeader::recordNumber of the last message we wrote. | |
| EarlyMessages | earlyMessages |
Private Attributes | |
| bool | coveringForCacheLog = false |
| whether we are the last resort for logging debugs() messages | |
|
inherited |
|
inlineinherited |
Definition at line 160 of file debug.cc.
References DebugChannel::earlyMessages.
Referenced by DebugModule::prepareToDie().
| bool StderrChannel::enabled | ( | const int | messageDebugLevel | ) | const |
whether we should write() the corresponding debugs() message now (assumes some higher-level code applied cache.log section/level filter)
Definition at line 647 of file debug.cc.
References coveringForCacheLog, DefaultStderrLevel, and ExplicitStderrLevel.
Referenced by shouldWrite(), and Debug::StderrEnabled().
|
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 537 of file debug.cc.
References DebugChannel::lastWrittenRecordNumber, DebugMessageHeader::recordNumber, DebugChannel::saveMessage(), DebugChannel::shouldWrite(), DebugChannel::stopEarlyMessageCollection(), and DebugChannel::write().
Referenced by DebugModule::log().
|
protectedinherited |
Definition at line 623 of file debug.cc.
References DebugChannel::lastWrittenRecordNumber, DebugMessageHeader::recordNumber, and DebugChannel::written.
Referenced by DebugChannel::writeToStream().
|
inlineinherited |
end early message buffering, without logging any saved messages
Definition at line 167 of file debug.cc.
References DebugChannel::earlyMessages.
Referenced by DebugChannel::StopSavingAndLog().
|
protectedinherited |
Definition at line 594 of file debug.cc.
References assert, DebugChannel::earlyMessages, EarlyMessagesLevel, and DebugMessageHeader::level.
Referenced by DebugChannel::log().
|
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 661 of file debug.cc.
References enabled(), and DebugMessageHeader::level.
| void StderrChannel::stopCoveringForCacheLog | ( | ) |
Definition at line 683 of file debug.cc.
References coveringForCacheLog, DBG_IMPORTANT, and debugs.
Referenced by DebugModule::useCacheLog().
|
inherited |
Definition at line 529 of file debug.cc.
References DebugChannel::earlyMessages, and DebugChannel::StopSavingAndLog().
Referenced by DebugChannel::log(), DebugModule::prepareToDie(), Debug::SettleStderr(), Debug::SettleSyslog(), Debug::StopCacheLogUse(), and DebugModule::useCacheLog().
|
staticprotectedinherited |
Definition at line 569 of file debug.cc.
References assert, debugs, CompiledDebugMessage::header, DebugChannel::name, DebugMessageHeader::recordNumber, DebugChannel::releaseEarlyMessages(), and DebugChannel::written.
Referenced by DebugChannel::stopEarlyMessageCollection(), and takeOver().
| void StderrChannel::takeOver | ( | CacheLogChannel & | cacheLogChannel | ) |
Definition at line 673 of file debug.cc.
References coveringForCacheLog, and DebugChannel::StopSavingAndLog().
Referenced by DebugModule::banCacheLogUse().
|
finalprotectedvirtual |
Implements DebugChannel.
Definition at line 667 of file debug.cc.
References DebugChannel::writeToStream().
|
protectedinherited |
Definition at line 613 of file debug.cc.
References debugLogTime(), DebugChannel::noteWritten(), ProcessLabel, and DebugMessageHeader::timestamp.
Referenced by CacheLogChannel::write(), and write().
|
private |
Definition at line 272 of file debug.cc.
Referenced by enabled(), stopCoveringForCacheLog(), and takeOver().
|
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 235 of file debug.cc.
Referenced by DebugChannel::collectingEarlyMessages(), DebugChannel::releaseEarlyMessages(), DebugChannel::saveMessage(), and DebugChannel::stopEarlyMessageCollection().
|
protectedinherited |
Definition at line 230 of file debug.cc.
Referenced by DebugChannel::log(), and DebugChannel::noteWritten().
|
protectedinherited |
Definition at line 224 of file debug.cc.
Referenced by DebugChannel::StopSavingAndLog().
|
protectedinherited |
Definition at line 227 of file debug.cc.
Referenced by DebugChannel::noteWritten(), and DebugChannel::StopSavingAndLog().