From 06fc6c7cc0219b3ec515eae70eb3858e29f6d485 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 10 Aug 2019 00:51:30 +0200 Subject: [PATCH] Bazel: enable logging for tests in org.eclipse.jgit.test - use slf4j-simple for logging in test runs - for log configuration see https://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html Change-Id: I9f0a532644b31162c867cd0d63f083296eaf6be5 Signed-off-by: Matthias Sohn --- org.eclipse.jgit.test/BUILD | 1 + org.eclipse.jgit.test/tst-rsrc/log4j.properties | 6 +++--- org.eclipse.jgit.test/tst-rsrc/simplelogger.properties | 9 +++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 org.eclipse.jgit.test/tst-rsrc/simplelogger.properties diff --git a/org.eclipse.jgit.test/BUILD b/org.eclipse.jgit.test/BUILD index b06778eed..89bc90f38 100644 --- a/org.eclipse.jgit.test/BUILD +++ b/org.eclipse.jgit.test/BUILD @@ -42,6 +42,7 @@ java_library( resources = DATA, deps = [ "//lib:junit", + "//lib:slf4j-simple", "//org.eclipse.jgit:jgit", "//org.eclipse.jgit.junit:junit", ], diff --git a/org.eclipse.jgit.test/tst-rsrc/log4j.properties b/org.eclipse.jgit.test/tst-rsrc/log4j.properties index ee1ac3515..fad593327 100644 --- a/org.eclipse.jgit.test/tst-rsrc/log4j.properties +++ b/org.eclipse.jgit.test/tst-rsrc/log4j.properties @@ -7,8 +7,8 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n -#log4j.appender.fileLogger.bufferedIO = true -#log4j.appender.fileLogger.bufferSize = 4096 +log4j.appender.fileLogger.bufferedIO = true +log4j.appender.fileLogger.bufferSize = 4096 -#log4j.logger.org.eclipse.jgit.util.FS = DEBUG +log4j.logger.org.eclipse.jgit.util.FS = DEBUG #log4j.logger.org.eclipse.jgit.internal.storage.file.FileSnapshot = DEBUG diff --git a/org.eclipse.jgit.test/tst-rsrc/simplelogger.properties b/org.eclipse.jgit.test/tst-rsrc/simplelogger.properties new file mode 100644 index 000000000..011b2f8bb --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/simplelogger.properties @@ -0,0 +1,9 @@ +org.slf4j.simpleLogger.logFile = System.err +org.slf4j.simpleLogger.cacheOutputStream = true +org.slf4j.simpleLogger.defaultLogLevel = info +org.slf4j.simpleLogger.showDateTime = true +org.slf4j.simpleLogger.dateTimeFormat = HH:mm:ss.SSSXXX +org.slf4j.simpleLogger.showThreadName = true + +#org.slf4j.simpleLogger.log.org.eclipse.jgit.util.FS = debug +#org.slf4j.simpleLogger.log.org.eclipse.jgit.internal.storage.file.FileSnapshot = debug