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 | |
Austin Schuh | 60e7794 | 2022-05-16 17:48:24 -0700 | [diff] [blame] | 3 | #include "aos/events/event_loop.h" |
Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 4 | #include "aos/logging/dynamic_log_command_generated.h" |
Stephan Pleines | 0960c26 | 2024-05-31 20:29:24 -0700 | [diff] [blame] | 5 | #include "aos/macros.h" |
Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 6 | |
| 7 | // The purpose of this class is to listen for /aos aos.logging.DynamicLogCommand |
| 8 | // and make changes to the log level of the current application based on that |
| 9 | // message. Currently the only supported command is changing the global vlog |
| 10 | // level. |
Stephan Pleines | d99b1ee | 2024-02-02 20:56:44 -0800 | [diff] [blame] | 11 | namespace aos::logging { |
Sarah Newman | a7e8793 | 2022-04-11 15:00:03 -0700 | [diff] [blame] | 12 | |
| 13 | class DynamicLogging { |
| 14 | public: |
| 15 | DynamicLogging(aos::EventLoop *event_loop); |
| 16 | ~DynamicLogging() {} |
| 17 | |
| 18 | private: |
| 19 | void HandleDynamicLogCommand(const DynamicLogCommand &command); |
| 20 | std::string application_name_; |
| 21 | DISALLOW_COPY_AND_ASSIGN(DynamicLogging); |
| 22 | }; |
| 23 | |
Stephan Pleines | d99b1ee | 2024-02-02 20:56:44 -0800 | [diff] [blame] | 24 | } // namespace aos::logging |