blob: 45f2a074d15f7f10053cbca4289f63779dee41e5 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#ifndef AOS_ATOM_CODE_LOGGING_LOGGING_H_
2#define AOS_ATOM_CODE_LOGGING_LOGGING_H_
3
Brian Silvermanf665d692013-02-17 22:11:39 -08004#include "aos/common/logging/logging_impl.h"
brians343bc112013-02-10 01:53:46 +00005
Brian Silvermanf665d692013-02-17 22:11:39 -08006namespace aos {
7namespace logging {
8namespace atom {
brians343bc112013-02-10 01:53:46 +00009
Brian Silvermanf665d692013-02-17 22:11:39 -080010// Calls AddImplementation to register the usual atom logging implementation
11// which sends the messages through a queue. This implementation relies on
12// another process(es) to read the log messages that it puts into the queue.
13// It gets called by aos::Init*.
14void Register();
brians343bc112013-02-10 01:53:46 +000015
Brian Silvermanf665d692013-02-17 22:11:39 -080016// Fairly simple wrappers around the raw queue calls.
brians343bc112013-02-10 01:53:46 +000017
Brian Silvermanf665d692013-02-17 22:11:39 -080018// This one never returns NULL if flags contains BLOCK.
19const LogMessage *ReadNext(int flags);
20const LogMessage *ReadNext(int flags, int *index);
21const LogMessage *ReadNext();
22LogMessage *Get();
23void Free(const LogMessage *msg);
24void Write(LogMessage *msg);
brians343bc112013-02-10 01:53:46 +000025
Brian Silvermanf665d692013-02-17 22:11:39 -080026} // namespace atom
27} // namespace logging
28} // namespace aos
brians343bc112013-02-10 01:53:46 +000029
30#endif