blob: eca07bf6bdeb5058fd42e34f9014e03fb685e62d [file] [log] [blame]
Tyler Chatow67ddb032020-01-12 14:30:04 -08001#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
8namespace aos {
9
10class AosLogToFbs {
11 public:
12 AosLogToFbs() {}
13
Austin Schuhad9e5eb2021-11-19 20:33:55 -080014 // 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 Schuha0c41ba2020-09-10 22:59:14 -070018 std::shared_ptr<logging::LogImplementation> implementation() const {
19 return implementation_;
20 }
Tyler Chatow67ddb032020-01-12 14:30:04 -080021
22 private:
23 Sender<logging::LogMessageFbs> log_sender_;
Austin Schuha0c41ba2020-09-10 22:59:14 -070024 std::shared_ptr<logging::LogImplementation> implementation_;
milind1f1dca32021-07-03 13:50:07 -070025 SendFailureCounter send_failure_counter_;
Tyler Chatow67ddb032020-01-12 14:30:04 -080026};
27
28} // namespace aos
29
30#endif // AOS_LOGGING_H_