class DlogReader

Defined at line 30 of file ../../zircon/kernel/lib/debuglog/include/lib/debuglog.h

DlogReaders drain debuglogs. Owners of DlogReaders are called back as

messages are pushed through the debuglog, via the Notify callback.

Public Methods

void DlogReader ()

Defined at line 34 of file ../../zircon/kernel/lib/debuglog/include/lib/debuglog.h

void ~DlogReader ()

Defined at line 507 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

void Initialize (NotifyCallback * notify, void * cookie, DLog * log)

Since DlogReaders typically capture containing objects via |cookie_|, they

use 2-phase initialization to avoid races in the contruction of the

DlogReader and the containing object.

The optional parameter `log` is used mainly for testing purpose. It should be left as default

for all other uses, in which case the static global DLOG will be used. If `log` takes the

default value i.e static global DLOG, it will outlive the DLogReader and hence there will be no

lifetime issues. If `log` is specified, as it would be in case of tests, the test has to

ensure that the `log` object outlives any DLogReaders associated to it.

Defined at line 512 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

zx_status_t Read (uint32_t flags, dlog_record_t * record, size_t * actual)

Read one record out of the log and store it in |record|.

Upon success, returns ZX_OK and sets *|actual| to the record's size.

Defined at line 440 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

void Notify ()

Defined at line 550 of file ../../zircon/kernel/lib/debuglog/debuglog.cc

void Disconnect ()

Similar to Initialize, DlogReaders are be manually stopped via |Disconnect|

to avoid reentrency issues in the DlogReader and its containing object.

Disconnect must be called before the destructor runs, if Initialize was called.

Defined at line 543 of file ../../zircon/kernel/lib/debuglog/debuglog.cc