From d05b57b3a496cca24cd5eaf0be068e13536a5344 Mon Sep 17 00:00:00 2001 From: Timo Lotterbach Date: Fri, 30 Nov 2012 06:41:26 -0800 Subject: [PATCH] LayerManagerCommands: fixed logging inside CommitCommand CommitCommand printed itself as creator of each executed command. Error state was logged wrong after one command failed. Signed-off-by: Timo Lotterbach --- LayerManagerCommands/src/CommitCommand.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LayerManagerCommands/src/CommitCommand.cpp b/LayerManagerCommands/src/CommitCommand.cpp index 830371a..9532e2c 100644 --- a/LayerManagerCommands/src/CommitCommand.cpp +++ b/LayerManagerCommands/src/CommitCommand.cpp @@ -36,11 +36,13 @@ ExecutionResult CommitCommand::execute(ICommandExecutor* executor) ICommand* command = (*iter); if (command) { + bool commandExecuteSuccess = true; ExecutionResult result = command->execute(executor); if (result == ExecutionFailed || result == ExecutionFailedRedraw) { success = false; + commandExecuteSuccess = false; } if (result == ExecutionFailedRedraw || result == ExecutionSuccessRedraw) @@ -48,10 +50,10 @@ ExecutionResult CommitCommand::execute(ICommandExecutor* executor) redraw = true; } - unsigned int pid = getSenderPid(); + unsigned int pid = command->getSenderPid(); LOG_INFO("CommitCommand", "executed " << command->getString() << " from " << executor->getSenderName(pid) << "(" << pid << ")" - << (success ? "+" : "-")); + << (commandExecuteSuccess ? "+" : "-")); delete command; } } -- 2.7.4