aos: add dynamic logging on an opt-in basis

Applications including this can have vlog changed with:

aos_send /aos aos.logging.DynamicLogCommand '{"name": "app", "vlog_level": 1}'

Change-Id: Id387cdb501ad84ed3e266a2077ea93478b480afa
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/logging/dynamic_logging.h b/aos/logging/dynamic_logging.h
new file mode 100644
index 0000000..9fd8fd0
--- /dev/null
+++ b/aos/logging/dynamic_logging.h
@@ -0,0 +1,26 @@
+#include <string>
+#include "aos/events/event_loop.h"
+
+#include "aos/logging/dynamic_log_command_generated.h"
+#include "glog/logging.h"
+
+// The purpose of this class is to listen for /aos aos.logging.DynamicLogCommand
+// and make changes to the log level of the current application based on that
+// message. Currently the only supported command is changing the global vlog
+// level.
+namespace aos {
+namespace logging {
+
+class DynamicLogging {
+ public:
+  DynamicLogging(aos::EventLoop *event_loop);
+  ~DynamicLogging() {}
+
+ private:
+  void HandleDynamicLogCommand(const DynamicLogCommand &command);
+  std::string application_name_;
+  DISALLOW_COPY_AND_ASSIGN(DynamicLogging);
+};
+
+}  // namespace logging
+}  // namespace aos