[xwiki/xwiki-platform] abb25f: [Misc] Apply the logging best practices to xwiki-p...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-platform Commit: abb25f5ac8f1aab19971c6afe48d6b2f8df194d1 https://github.com/xwiki/xwiki-platform/commit/abb25f5ac8f1aab19971c6afe48d6... Author: Vincent Massol <[email protected]> Date: 2026-08-01 (Sat, 01 Aug 2026) Changed paths: M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/DockerTestUtils.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/StopFileWatcher.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/WARBuilder.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/XWikiDockerExtension.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/configuration/ConfigurationFilesGenerator.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/database/DatabaseContainerExecutor.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/src/main/java/org/xwiki/test/docker/internal/junit5/servletengine/ServletContainerExecutor.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/src/main/java/org/xwiki/test/integration/XWikiExecutorSuite.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/src/main/java/org/xwiki/test/integration/maven/ArtifactResolver.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/src/main/java/org/xwiki/test/integration/maven/DebuggingDependencyVisitor.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestDebugger.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/XWikiWebDriver.java M xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/po/BasePage.java Log Message: ----------- [Misc] Apply the logging best practices to xwiki-platform-test (#6057) * [Misc] Apply the logging best practices to xwiki-platform-test Follows https://dev.xwiki.org/xwiki/bin/view/Community/CodeStyle/JavaCodeStyle/#HLog... Clears the 39 sites the logging audit found in xwiki-platform-test, of which 25 needed a change: * Surround placeholder values with [] so they are visually delimited. * Stop passing a Throwable to warn(), using ExceptionUtils.getRootCauseMessage() instead, so that stack traces stay reserved for errors. In XWikiWebDriver the warning logs a synthetic exception only to capture the wasteful findElement() caller, so the stack trace is the whole payload: it moves into a "Call stack is [{}]" placeholder via ExceptionUtils.getStackTrace() rather than being dropped. * Replace the indentation prefix concatenated into DebuggingDependencyVisitor's message with a leading {} placeholder. * Trim the trailing space before the stack trace logged by BasePage. DockerTestUtils used the Plexus ExceptionUtils, which has no getRootCauseMessage(); it now uses the Commons Lang one, whose getRootCause() serves the existing EOFException check just as well. The 14 remaining sites are deliberately left alone, per the audit's own exclusions: values that already bracket themselves (a List in WARBuilder, a Collection in RestExtensionInstaller, the script result in TestUtils, the [\n{}\n] blocks in LogCaptureValidator), the compound [{} : {}] and [{}/{}] identifiers in the WCAG classes and BasePage, MavenResolver's ModelProblem.getMessage() which is not an exception message, and the warn() with a stack trace in ValidateConsoleExtensionTest, which is the fixture the test validates. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [Misc] Keep the call stack in the two TestUtils warnings Both warnings are emitted from helpers that arbitrary test code calls, so the caller frame is what tells you which test tripped them. Reducing them to a root-cause message dropped exactly that. They now log the full trace through a "Call stack is [{}]" placeholder, like the wasteful-wait warning in XWikiWebDriver, so the location is still there while warn() keeps the SLF4J Throwable slot free. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications