blob: 3dc87634019b263b70d6c58407d4e78c44b935e7 [file] [log] [blame]
Brian Silverman14fd0fb2014-01-14 21:42:01 -08001#ifndef AOS_LINUX_CODE_LOGGING_LOGGING_H_
2#define AOS_LINUX_CODE_LOGGING_LOGGING_H_
brians343bc112013-02-10 01:53:46 +00003
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 {
Brian Silverman14fd0fb2014-01-14 21:42:01 -08008namespace linux_code {
brians343bc112013-02-10 01:53:46 +00009
Brian Silverman14fd0fb2014-01-14 21:42:01 -080010// Calls AddImplementation to register the usual linux logging implementation
Brian Silvermanf665d692013-02-17 22:11:39 -080011// 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.
Brian Silverman78968542014-03-05 17:03:43 -080013// This function is usually called by aos::Init*.
Brian Silvermanf665d692013-02-17 22:11:39 -080014void 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 Silverman14fd0fb2014-01-14 21:42:01 -080026} // namespace linux_code
Brian Silvermanf665d692013-02-17 22:11:39 -080027} // namespace logging
28} // namespace aos
brians343bc112013-02-10 01:53:46 +000029
30#endif