brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #ifndef AOS_ATOM_CODE_LOGGING_LOGGING_H_ |
| 2 | #define AOS_ATOM_CODE_LOGGING_LOGGING_H_ |
| 3 | |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame^] | 4 | #include "aos/common/logging/logging_impl.h" |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 5 | |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame^] | 6 | namespace aos { |
| 7 | namespace logging { |
| 8 | namespace atom { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 9 | |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame^] | 10 | // 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*. |
| 14 | void Register(); |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 15 | |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame^] | 16 | // Fairly simple wrappers around the raw queue calls. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 17 | |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame^] | 18 | // This one never returns NULL if flags contains BLOCK. |
| 19 | const LogMessage *ReadNext(int flags); |
| 20 | const LogMessage *ReadNext(int flags, int *index); |
| 21 | const LogMessage *ReadNext(); |
| 22 | LogMessage *Get(); |
| 23 | void Free(const LogMessage *msg); |
| 24 | void Write(LogMessage *msg); |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 25 | |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame^] | 26 | } // namespace atom |
| 27 | } // namespace logging |
| 28 | } // namespace aos |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 29 | |
| 30 | #endif |