Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 1 | #ifndef AOS_LINUX_CODE_LOGGING_LOGGING_H_ |
| 2 | #define AOS_LINUX_CODE_LOGGING_LOGGING_H_ |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 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 { |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 8 | namespace linux_code { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 9 | |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 10 | // Calls AddImplementation to register the usual linux logging implementation |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame] | 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. |
Brian Silverman | 7896854 | 2014-03-05 17:03:43 -0800 | [diff] [blame^] | 13 | // This function is usually called by aos::Init*. |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame] | 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 | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 26 | } // namespace linux_code |
Brian Silverman | f665d69 | 2013-02-17 22:11:39 -0800 | [diff] [blame] | 27 | } // namespace logging |
| 28 | } // namespace aos |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 29 | |
| 30 | #endif |