Codebase list stealth / upstream/4.01.11 README.messages
upstream/4.01.11

Tree @upstream/4.01.11 (Download .tar.gz)

README.messages @upstream/4.01.11raw · history · blame

Messages sent to m1, m2, and m3 (see ../msg) are sent to imsg.

LogUnit::setupLogs() creates an FBB::Log and FBB::SyslogSteam if requested so
by options. 

It adds these files to an FBB::MultiStreambuf, and (if requested by --stdout)
also adds cout. 

If any streams are stored, the MultiStreambuf is installed in imsg. Following
this, all messages inserted into imsg are sent to the requested log streams.

Fatal messages, sent to fmsg, are handled similarly:

A MultiStreambuf receives imsg, and optionally (when calling setupLogs(ostream
&report)) into the ostream which inserts messages into the Report object.

The stream received by setupLogs is itself a wrapper around the actual Report
object, and its streambuf is defined in stealth/stealth.ih: all text inserted
into fmsg is also sent to this wrapper ostream, which forwards its characters
to its streambuffer's overflow member. This member sends all its characters to
Stealth's d_report object. When the wrapper stream is flushed, it calls
d_report.mail(), to process d_report's info by mail.

LogUnit:
========

    SyslogStream         --+                
                           |
    Log                  --+--> MultiStreambuf
                           |          |
    cout (with --stdout) --+          |
                                      |
                                      |
                                      v
                          imsg.reset(...)
                            |
                 +----------+----------+
                 m1         m2         m3


    imsg    ----+
                |
                +--> MultiStreambuf
                |           |
    report  ----+           |
                            |
                            v
                fmsg.reset(...)