From 01a6119ffd561cdec42ffeff827e72e1af1ae1ce Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 28 Feb 2022 13:14:23 +0100 Subject: Executor: Log failing action's command --- src/buildtool/execution_engine/executor/executor.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/buildtool/execution_engine/executor/executor.hpp') diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index 3cba3896..6ed5a55f 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -281,6 +281,7 @@ class ExecutorImpl { logger.Emit(LogLevel::Error, "action returned non-zero exit code {}", response->ExitCode()); + PrintError(logger, action->Command()); return false; } } @@ -301,6 +302,7 @@ class ExecutorImpl { } return message; }); + PrintError(logger, action->Command()); return false; } @@ -337,6 +339,13 @@ class ExecutorImpl { }); } } + + void static PrintError(Logger const& logger, + std::vector const& command) noexcept { + logger.Emit(LogLevel::Error, + "Failed to execute command:\n{}", + nlohmann::json{command}.dump()); + } }; /// \brief Executor for using concrete Execution API. -- cgit v1.2.3