Skip to content

Commit 3d14726

Browse files
committed
Belongs to last commit: 2 more places for .getName() instead of toString().
1 parent 3851d14 commit 3d14726

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/optimaize/command4j/ext/extensions/logging/customlogging/CommandExecutionLoggerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void before(@NotNull Command<A, R> command, @NotNull ExecutionContext ec,
4444
@Override
4545
public void afterSuccess(@NotNull Command<A, R> command, @NotNull ExecutionContext ec, @NotNull Optional<A> arg, @Nullable R result) {
4646
if (logArgumentInResult) {
47-
logger.info("After success {} for arg {} got result: {}", new Object[]{command, arg, result});
47+
logger.info("After success {} for arg {} got result: {}", new Object[]{command.getName(), arg, result});
4848
} else {
4949
logger.info("After success {} result: {}", command.getName(), result);
5050
}
@@ -53,7 +53,7 @@ public void afterSuccess(@NotNull Command<A, R> command, @NotNull ExecutionConte
5353
@Override
5454
public void afterFailure(@NotNull Command<A, R> command, @NotNull ExecutionContext ec, @NotNull Optional<A> arg, @NotNull Exception exception) {
5555
if (logArgumentInResult) {
56-
logger.info("After failure {} for arg {} got exception: {}", new Object[]{command, arg, exception});
56+
logger.info("After failure {} for arg {} got exception: {}", new Object[]{command.getName(), arg, exception});
5757
} else {
5858
logger.info("After failure {} exception: {}", command.getName(), exception);
5959
}

0 commit comments

Comments
 (0)