From 5a45575788e3c2c07dac774f28f38cc1c2eccbf3 Mon Sep 17 00:00:00 2001 From: jgomer2001 Date: Wed, 19 Oct 2022 07:38:44 -0500 Subject: [PATCH] chore: log statements optimization #2672 --- .../java/io/jans/agama/engine/service/ActionService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agama/engine/src/main/java/io/jans/agama/engine/service/ActionService.java b/agama/engine/src/main/java/io/jans/agama/engine/service/ActionService.java index dbcba4926a2..7ac0c37583f 100644 --- a/agama/engine/src/main/java/io/jans/agama/engine/service/ActionService.java +++ b/agama/engine/src/main/java/io/jans/agama/engine/service/ActionService.java @@ -105,7 +105,9 @@ public Object callAction(Object instance, String className, String methodName, O throw new InstantiationException(msg); } - logger.debug("Constructor found: {}", constr.toGenericString()); + if (logger.isDebugEnabled()) { + logger.debug("Constructor found: {}", constr.toGenericString()); + } Object[] args = getArgsForCall(constr, arity, rhinoArgs); logger.debug("Creating an instance"); @@ -128,7 +130,9 @@ public Object callAction(Object instance, String className, String methodName, O throw new NoSuchMethodException(msg); } - logger.debug("Method found: {}", javaMethod.toGenericString()); + if (logger.isDebugEnabled()) { + logger.debug("Method found: {}", javaMethod.toGenericString()); + } Object[] args = getArgsForCall(javaMethod, arity, rhinoArgs); logger.debug("Performing method call");