blob: efb2b252a7078beda0198375d1d8cea28a91d2e4 [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_;
Tyler Chatow67ddb032020-01-12 14:30:04 -080025};
26
27} // namespace aos
28
29#endif // AOS_LOGGING_H_