|
Squid Web Cache master
|
a receiver of debugs() messages (e.g., stderr or cache.log) More...
Classes | |
| class | Logger |
| output iterator for writing CompiledDebugMessages to a given channel More... | |
Public Types | |
| using | EarlyMessages = std::unique_ptr< CompiledDebugMessages > |
Public Member Functions | |
| DebugChannel (const char *aName) | |
| virtual | ~DebugChannel ()=default |
| DebugChannel (DebugChannel &&)=delete | |
| 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 | |
| virtual bool | shouldWrite (const DebugMessageHeader &) const =0 |
| virtual void | write (const DebugMessageHeader &, const CompiledDebugMessageBody &)=0 |
| 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 |
| using DebugChannel::EarlyMessages = std::unique_ptr<CompiledDebugMessages> |
|
virtualdefault |
|
delete |
|
inline |
Definition at line 160 of file debug.cc.
References earlyMessages.
Referenced by DebugModule::prepareToDie().
| void DebugChannel::log | ( | const DebugMessageHeader & | header, |
| const CompiledDebugMessageBody & | body | ||
| ) |
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 lastWrittenRecordNumber, DebugMessageHeader::recordNumber, saveMessage(), shouldWrite(), stopEarlyMessageCollection(), and write().
Referenced by DebugModule::log().
|
protected |
Definition at line 623 of file debug.cc.
References lastWrittenRecordNumber, DebugMessageHeader::recordNumber, and written.
Referenced by writeToStream().
|
inline |
end early message buffering, without logging any saved messages
Definition at line 167 of file debug.cc.
References earlyMessages.
Referenced by StopSavingAndLog().
|
protected |
Definition at line 594 of file debug.cc.
References assert, earlyMessages, EarlyMessagesLevel, and DebugMessageHeader::level.
Referenced by log().
|
protectedpure virtual |
whether we should write() the corresponding debugs() message now (assumes some higher-level code applied cache.log section/level filter)
Implemented in CacheLogChannel, StderrChannel, and SyslogChannel.
Referenced by log().
| void DebugChannel::stopEarlyMessageCollection | ( | ) |
Definition at line 529 of file debug.cc.
References earlyMessages, and StopSavingAndLog().
Referenced by log(), DebugModule::prepareToDie(), Debug::SettleStderr(), Debug::SettleSyslog(), Debug::StopCacheLogUse(), and DebugModule::useCacheLog().
|
staticprotected |
Definition at line 569 of file debug.cc.
References assert, debugs, CompiledDebugMessage::header, name, DebugMessageHeader::recordNumber, releaseEarlyMessages(), and written.
Referenced by stopEarlyMessageCollection(), and StderrChannel::takeOver().
|
protectedpure virtual |
Implemented in CacheLogChannel, StderrChannel, and SyslogChannel.
Referenced by log().
|
protected |
Definition at line 613 of file debug.cc.
References debugLogTime(), noteWritten(), ProcessLabel, and DebugMessageHeader::timestamp.
Referenced by CacheLogChannel::write(), and StderrChannel::write().
|
protected |
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 collectingEarlyMessages(), releaseEarlyMessages(), saveMessage(), and stopEarlyMessageCollection().
|
protected |
Definition at line 230 of file debug.cc.
Referenced by log(), and noteWritten().
|
protected |
Definition at line 224 of file debug.cc.
Referenced by StopSavingAndLog().
|
protected |
Definition at line 227 of file debug.cc.
Referenced by noteWritten(), and StopSavingAndLog().