Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 1 | #include <string> |
Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 2 | |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 3 | #include "glog/logging.h" |
| 4 | |
Austin Schuh | 60e7794 | 2022-05-16 17:48:24 -0700 | [diff] [blame] | 5 | #include "aos/events/event_loop.h" |
Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 6 | #include "aos/logging/dynamic_log_command_generated.h" |
Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 7 | |
| 8 | // The purpose of this class is to listen for /aos aos.logging.DynamicLogCommand |
| 9 | // and make changes to the log level of the current application based on that |
| 10 | // message. Currently the only supported command is changing the global vlog |
| 11 | // level. |
| 12 | namespace aos { |
| 13 | namespace logging { |
| 14 | |
| 15 | class DynamicLogging { |
| 16 | public: |
| 17 | DynamicLogging(aos::EventLoop *event_loop); |
| 18 | ~DynamicLogging() {} |
| 19 | |
| 20 | private: |
| 21 | void HandleDynamicLogCommand(const DynamicLogCommand &command); |
| 22 | std::string application_name_; |
| 23 | DISALLOW_COPY_AND_ASSIGN(DynamicLogging); |
| 24 | }; |
| 25 | |
| 26 | } // namespace logging |
| 27 | } // namespace aos |