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 | |
Austin Schuh | ad9e5eb | 2021-11-19 20:33:55 -0800 | [diff] [blame] | 14 | // Initializes a sender with the provided name and sender. Note: the name |
| 15 | // needs to be valid until this object is destroyed. |
| 16 | void Initialize(const std::string *name, |
| 17 | Sender<logging::LogMessageFbs> log_sender); |
Austin Schuh | a0c41ba | 2020-09-10 22:59:14 -0700 | [diff] [blame] | 18 | std::shared_ptr<logging::LogImplementation> implementation() const { |
| 19 | return implementation_; |
| 20 | } |
Tyler Chatow | 67ddb03 | 2020-01-12 14:30:04 -0800 | [diff] [blame] | 21 | |
| 22 | private: |
| 23 | Sender<logging::LogMessageFbs> log_sender_; |
Austin Schuh | a0c41ba | 2020-09-10 22:59:14 -0700 | [diff] [blame] | 24 | std::shared_ptr<logging::LogImplementation> implementation_; |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame^] | 25 | SendFailureCounter send_failure_counter_; |
Tyler Chatow | 67ddb03 | 2020-01-12 14:30:04 -0800 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | } // namespace aos |
| 29 | |
| 30 | #endif // AOS_LOGGING_H_ |