From 906ec15ff2d4fad2728b141ce1d4d4004c61f9ce Mon Sep 17 00:00:00 2001 From: Andre Detsch Date: Fri, 29 Nov 2024 14:18:08 -0300 Subject: [PATCH] apps: Log execution of external commands during apps management Signed-off-by: Andre Detsch --- src/exec.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/exec.h b/src/exec.h index c87208b7..9b5be16b 100644 --- a/src/exec.h +++ b/src/exec.h @@ -5,6 +5,7 @@ #include #include #include +#include "logging/logging.h" struct ExecError : std::runtime_error { ExecError(const std::string& msg_prefix, const std::string& cmd, const std::string& err_msg, int exit_code) @@ -23,6 +24,7 @@ static void exec(const std::string& cmd, const std::string& err_msg_prefix, Args boost::asio::io_service io_service; try { + LOG_DEBUG << "Running: `" << cmd << "`"; boost::process::child child_process(cmd, boost::process::std_err > err_output, boost::process::on_exit = child_process_exit_code, io_service, std::forward(args)...); @@ -39,6 +41,7 @@ static void exec(const std::string& cmd, const std::string& err_msg_prefix, Args } const auto exit_code{child_process_exit_code.get()}; + LOG_DEBUG << "Command exited with code " << exit_code; if (exit_code != EXIT_SUCCESS) { const auto err_msg{err_output.get()};