Tyler Chatow | 67ddb03 | 2020-01-12 14:30:04 -0800 | [diff] [blame^] | 1 | #ifndef AOS_LOGGING_H_ |
| 2 | #define AOS_LOGGING_H_ |
| 3 | |
| 4 | #include "aos/events/event_loop.h" |
| 5 | #include "aos/logging/implementations.h" |
| 6 | #include "aos/logging/log_message_generated.h" |
| 7 | |
| 8 | namespace aos { |
| 9 | |
| 10 | class AosLogToFbs { |
| 11 | public: |
| 12 | AosLogToFbs() {} |
| 13 | |
| 14 | // TODO(Tyler): Deregister logger on destruction to avoid memory leaks |
| 15 | |
| 16 | void Initialize(Sender<logging::LogMessageFbs> log_sender); |
| 17 | |
| 18 | private: |
| 19 | Sender<logging::LogMessageFbs> log_sender_; |
| 20 | logging::ScopedLogRestorer prev_logger_; |
| 21 | }; |
| 22 | |
| 23 | } // namespace aos |
| 24 | |
| 25 | #endif // AOS_LOGGING_H_ |