diff --git a/build.gradle b/build.gradle index 9bd5ecdd6e..a900f60e94 100644 --- a/build.gradle +++ b/build.gradle @@ -372,7 +372,9 @@ dependencies { testImplementation(libs.bundles.xmlunit) testImplementation(project(":language-modules")) - testImplementation(libs.languagetool.server) + testImplementation(libs.languagetool.server) { + exclude module: "logback-classic" + } testRuntimeOnly(libs.slf4j.jdk14) // JAXB codegen only @@ -1587,6 +1589,7 @@ test { if (project.hasProperty('headless')) { systemProperty 'java.awt.headless', 'true' } + systemProperty 'java.util.logging.config.file', "${rootDir}/config/test/logger.properties" } tasks.register('testIntegration', JavaExec) { @@ -1599,6 +1602,7 @@ tasks.register('testIntegration', JavaExec) { mainClass = 'org.omegat.core.data.TestTeamIntegration' classpath = sourceSets.testIntegration.runtimeClasspath systemProperties = System.properties + systemProperty 'java.util.logging.config.file', "${rootDir}/config/test/logger.properties" } tasks.register('testOnJava17', Test) { @@ -1607,9 +1611,11 @@ tasks.register('testOnJava17', Test) { languageVersion = JavaLanguageVersion.of(17) vendor = JvmVendorSpec.ADOPTIUM } + systemProperties = System.properties if (project.hasProperty('headless')) { systemProperty 'java.awt.headless', 'true' } + systemProperty 'java.util.logging.config.file', "${rootDir}/config/test/logger.properties" group = 'verification' } @@ -1619,9 +1625,11 @@ tasks.register('testOnJava21', Test) { languageVersion = JavaLanguageVersion.of(21) vendor = JvmVendorSpec.ADOPTIUM } + systemProperties = System.properties if (project.hasProperty('headless')) { systemProperty 'java.awt.headless', 'true' } + systemProperty 'java.util.logging.config.file', "${rootDir}/config/test/logger.properties" group = 'verification' } @@ -1637,7 +1645,7 @@ tasks.register('testAcceptance', Test) { testClassesDirs = sourceSets.testAcceptance.output.classesDirs classpath = sourceSets.testAcceptance.runtimeClasspath systemProperties = System.properties - shouldRunAfter(tasks.test) + systemProperty 'java.util.logging.config.file', "${rootDir}/config/test/logger.properties" } ext.mavenStyleVersion = version.replace('_', '-') diff --git a/config/test/logger.properties b/config/test/logger.properties new file mode 100644 index 0000000000..7c88a237c4 --- /dev/null +++ b/config/test/logger.properties @@ -0,0 +1,35 @@ +handlers = java.util.logging.ConsoleHandler + +# Set the default logging level for the root logger +.level = INFO +org.omegat.level = ALL + +# Set the default logging level +java.util.logging.ConsoleHandler.level = ALL +org.omegat.util.logging.OmegaTFileHandler.level = ALL + +#org.omegat.util.logging.OmegaTLogFormatter.mask=$time: $level: $text $key +org.omegat.util.logging.OmegaTLogFormatter.mask=$time: $threadName [$level] $key $text +#org.omegat.util.logging.OmegaTLogFormatter.mask=$mark: $level: $text $key + +org.omegat.util.logging.OmegaTLogFormatter.timeFormat=HH:mm:ss.SSS + +java.util.logging.ConsoleHandler.formatter = org.omegat.util.logging.OmegaTLogFormatter + +# precise control of log levels, please change when debug +org.omegat.core.data.level = INFO +org.omegat.core.threads.level = INFO +org.omegat.core.team2.impl.level = INFO +org.omegat.core.team2.level = INFO +org.omegat.gui.editor.history.level = INFO +org.omegat.gui.matches.level = INFO +org.omegat.util.gui.level = INFO +org.omegat.util.level = INFO + +# Suppress warning from depndency jStyleParser +cz.vutbr.web.level = SEVERE +org.fit.net.level = SEVERE + +# We can enable specific logging level for some classes +#org.omegat.core.data.SaveThread.level = FINEST +org.omegat.core.segmentation.level = FINEST