Added quiet flag for application object
The application object sometimes spews failed to start messages when
executing intensive commands with auto-restart, such as ssh. Although
the nonzero return codes are to be expected, a quiet flag was added as
to reduce the amount of irrelevant messages.
Change-Id: I11b5391b423f1e4763683a2334f9aa75d29b23f8
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/subprocess.h b/aos/starter/subprocess.h
index 1f16168..60732c3 100644
--- a/aos/starter/subprocess.h
+++ b/aos/starter/subprocess.h
@@ -55,15 +55,18 @@
// automatically.
class Application {
public:
+ enum class QuietLogging { kYes, kNo };
Application(const aos::Application *application, aos::EventLoop *event_loop,
- std::function<void()> on_change);
+ std::function<void()> on_change,
+ QuietLogging quiet_flag = QuietLogging::kNo);
// executable_name is the actual executable path.
// When sudo is not used, name is used as argv[0] when exec'ing
// executable_name. When sudo is used it's not possible to pass in a
// distinct argv[0].
Application(std::string_view name, std::string_view executable_name,
- aos::EventLoop *event_loop, std::function<void()> on_change);
+ aos::EventLoop *event_loop, std::function<void()> on_change,
+ QuietLogging quiet_flag = QuietLogging::kNo);
flatbuffers::Offset<aos::starter::ApplicationStatus> PopulateStatus(
flatbuffers::FlatBufferBuilder *builder, util::Top *top);
@@ -179,6 +182,8 @@
std::unique_ptr<MemoryCGroup> memory_cgroup_;
+ QuietLogging quiet_flag_ = QuietLogging::kNo;
+
DISALLOW_COPY_AND_ASSIGN(Application);
};