blob: e3d3a6f823f3d8a95a51f65a615f773af584ab8b [file] [log] [blame]
Sarah Newmana7e87932022-04-11 15:00:03 -07001#include <string>
Sarah Newmana7e87932022-04-11 15:00:03 -07002
Philipp Schrader790cb542023-07-05 21:06:52 -07003#include "glog/logging.h"
4
Austin Schuh60e77942022-05-16 17:48:24 -07005#include "aos/events/event_loop.h"
Sarah Newmana7e87932022-04-11 15:00:03 -07006#include "aos/logging/dynamic_log_command_generated.h"
Sarah Newmana7e87932022-04-11 15:00:03 -07007
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.
Stephan Pleinesd99b1ee2024-02-02 20:56:44 -080012namespace aos::logging {
Sarah Newmana7e87932022-04-11 15:00:03 -070013
14class DynamicLogging {
15 public:
16 DynamicLogging(aos::EventLoop *event_loop);
17 ~DynamicLogging() {}
18
19 private:
20 void HandleDynamicLogCommand(const DynamicLogCommand &command);
21 std::string application_name_;
22 DISALLOW_COPY_AND_ASSIGN(DynamicLogging);
23};
24
Stephan Pleinesd99b1ee2024-02-02 20:56:44 -080025} // namespace aos::logging