This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch maintenance-branch in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 4fe329ea23e0d288af956eb85cf70adf031f75cd Author: Dan Haywood <[email protected]> AuthorDate: Tue Jun 25 17:44:08 2024 +0200 CAUSEWAY-3751: converts some log.debug to log.trace in WebRequestCycleForCauseway --- .../integration/WebRequestCycleForCauseway.java | 51 ++++++++++++++-------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/viewers/wicket/viewer/src/main/java/org/apache/causeway/viewer/wicket/viewer/integration/WebRequestCycleForCauseway.java b/viewers/wicket/viewer/src/main/java/org/apache/causeway/viewer/wicket/viewer/integration/WebRequestCycleForCauseway.java index e5ae7b0f6c..5eb850fcb8 100644 --- a/viewers/wicket/viewer/src/main/java/org/apache/causeway/viewer/wicket/viewer/integration/WebRequestCycleForCauseway.java +++ b/viewers/wicket/viewer/src/main/java/org/apache/causeway/viewer/wicket/viewer/integration/WebRequestCycleForCauseway.java @@ -26,7 +26,6 @@ import java.util.Optional; import javax.servlet.http.HttpServletRequest; import org.apache.causeway.applib.services.metrics.MetricsService; -import org.apache.causeway.applib.services.publishing.log.Timing; import org.apache.wicket.Application; import org.apache.wicket.IPageFactory; @@ -129,8 +128,8 @@ implements @Override public synchronized void onBeginRequest(final RequestCycle requestCycle) { - if(log.isDebugEnabled()) { - log.debug("onBeginRequest in"); + if(log.isTraceEnabled()) { + log.trace("onBeginRequest in"); } if (!Session.exists()) { @@ -138,9 +137,13 @@ implements // If there is no remember me cookie, user will be redirected to sign in and no need to notify. if (userHasSessionWithRememberMe(requestCycle)) { requestCycle.setMetaData(SESSION_LIFECYCLE_PHASE_KEY, SessionLifecyclePhase.EXPIRED); - log.debug("flagging the RequestCycle as expired (rememberMe feature is active for the current user)"); + if(log.isTraceEnabled()) { + log.trace("flagging the RequestCycle as expired (rememberMe feature is active for the current user)"); + } + } + if(log.isTraceEnabled()) { + log.trace("onBeginRequest out - session was not opened (because no Session)"); } - log.debug("onBeginRequest out - session was not opened (because no Session)"); return; } @@ -181,26 +184,33 @@ implements // Note: this is a no-op if an interactionContext layer was already opened and is unchanged. interactionService.openInteraction(interactionContext1); + if(log.isTraceEnabled()) { + log.trace("onBeginRequest out - session was opened"); + } + if(log.isDebugEnabled()) { timings.set(new Timing()); - log.debug("onBeginRequest out - session was opened"); + log.debug("onBeginRequest ..."); } - } @Override public void onRequestHandlerResolved(final RequestCycle requestCycle, final IRequestHandler handler) { - log.debug("onRequestHandlerResolved in (handler: {}, hasSession: {})", - ()->handler.getClass().getName(), - ()->Session.exists() ? Session.get().hashCode() : "false"); + if(log.isTraceEnabled()) { + log.trace("onRequestHandlerResolved in (handler: {}, hasSession: {})", + ()->handler.getClass().getName(), + ()->Session.exists() ? Session.get().hashCode() : "false"); + } // this nested class is hidden; it seems it is always used to create a new session after one has expired if("org.apache.wicket.request.flow.ResetResponseException$ResponseResettingDecorator" .equals(handler.getClass().getName()) && SessionLifecyclePhase.isExpired(requestCycle)) { - log.debug("Transferring the 'expired' flag into the current session."); + if(log.isTraceEnabled()) { + log.trace("Transferring the 'expired' flag into the current session."); + } SessionLifecyclePhase.transferExpiredFlagToSession(); } else if(handler instanceof RenderPageRequestHandler) { @@ -227,11 +237,15 @@ implements // has gone by, could result in the message displayed too often, // but thats better than no message displayed at all if(SessionLifecyclePhase.isExpiryMessageTimeframeExpired()) { - log.debug("clear the session's active-after-expired flag (expiry-message timeframe has expired"); + if(log.isTraceEnabled()) { + log.trace("clear the session's active-after-expired flag (expiry-message timeframe has expired"); + } SessionLifecyclePhase.clearExpiredFlag(); } else { getMessageBroker().ifPresent(broker -> { - log.debug("render 'expired' message"); + if(log.isTraceEnabled()) { + log.trace("render 'expired' message"); + } broker.addMessage(translate("You have been redirected to the home page " + "as your session expired (no recent activity).")); }); @@ -239,8 +253,9 @@ implements } } - log.debug("onRequestHandlerResolved out"); - + if(log.isTraceEnabled()) { + log.trace("onRequestHandlerResolved out"); + } } @@ -250,8 +265,9 @@ implements */ @Override public void onRequestHandlerExecuted(final RequestCycle requestCycle, final IRequestHandler handler) { - log.debug("onRequestHandlerExecuted: handler: {}", handler.getClass().getName()); - + if(log.isTraceEnabled()) { + log.trace("onRequestHandlerExecuted: handler: {}", handler.getClass().getName()); + } } /** @@ -273,7 +289,6 @@ implements getMetaModelContext().lookupService(InteractionService.class).ifPresent( InteractionService::closeInteractionLayers ); - } @Override
