Support --verbose option in edit monitor
If --verbose option is set, logging in DEBUG level, otherwise logging
in INFO level, by default, user should run edit monitor without verbose
option to reduce the log size.
Test: make edit_monitor then run it and check the log file manually
Bug: 365617369
Change-Id: Ibdbd2bdd1ff373f7924c60f1b382b14678cf0a92
diff --git a/tools/edit_monitor/daemon_manager.py b/tools/edit_monitor/daemon_manager.py
index 970bd92..c0a57ab 100644
--- a/tools/edit_monitor/daemon_manager.py
+++ b/tools/edit_monitor/daemon_manager.py
@@ -154,7 +154,7 @@
def stop(self):
"""Stops the daemon process and removes the pidfile."""
- logging.debug("in daemon manager cleanup.")
+ logging.info("in daemon manager cleanup.")
try:
if self.daemon_process:
# The daemon process might already in termination process,
@@ -163,7 +163,7 @@
if self.daemon_process.is_alive():
self._terminate_process(self.daemon_process.pid)
self._remove_pidfile()
- logging.debug("Successfully stopped daemon manager.")
+ logging.info("Successfully stopped daemon manager.")
except Exception as e:
logging.exception("Failed to stop daemon manager with error %s", e)
self._send_error_event_to_clearcut(
@@ -179,7 +179,7 @@
Stops the current daemon manager and reboots the entire process based on
the binary file. Exits directly If the binary file no longer exists.
"""
- logging.debug("Rebooting process based on binary %s.", self.binary_path)
+ logging.info("Rebooting process based on binary %s.", self.binary_path)
# Stop the current daemon manager first.
self.stop()