diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-02-28 13:14:23 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-02-28 14:03:23 +0100 |
commit | 01a6119ffd561cdec42ffeff827e72e1af1ae1ce (patch) | |
tree | 9e29d00749fd9884e683992d0b84071de29625e9 | |
parent | 0c9c464ffeadf4963f4b0ae5c296f727b51db2ff (diff) | |
download | justbuild-01a6119ffd561cdec42ffeff827e72e1af1ae1ce.tar.gz |
Executor: Log failing action's command
-rw-r--r-- | src/buildtool/execution_engine/executor/executor.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<std::string> const& command) noexcept { + logger.Emit(LogLevel::Error, + "Failed to execute command:\n{}", + nlohmann::json{command}.dump()); + } }; /// \brief Executor for using concrete Execution API. |