Wip: Configure logback logging

This commit is contained in:
Paul Schaub 2021-08-25 12:39:31 +02:00
parent 4d6ca80e25
commit 1124c6fd15
5 changed files with 30 additions and 0 deletions

View File

@ -36,6 +36,8 @@ dependencies {
// https://todd.ginsberg.com/post/testing-system-exit/
testImplementation 'com.ginsberg:junit5-system-exit:1.1.1'
testImplementation 'ch.qos.logback:logback-classic:1.2.5'
/*
implementation "org.bouncycastle:bcprov-debug-jdk15on:$bouncyCastleVersion"
/*/

View File

@ -0,0 +1,12 @@
<configuration>
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<encoder>
<pattern>%blue(%-5level) %green(%logger{35}) - %msg %n</pattern>
</encoder>
</appender>
<logger name="org.apache" level="INFO ">
<appender-ref ref="STDERR"/>
</logger>
</configuration>

View File

@ -134,11 +134,13 @@ public final class DecryptionStreamFactory {
// Not an OpenPGP message.
// Reset the buffered stream to parse the message as arbitrary binary data
// to allow for detached signature verification.
LOGGER.debug("The message appears to not be an OpenPGP message. This is probably data signed with detached signatures?");
bufferedIn.reset();
inputStream = bufferedIn;
} catch (IOException e) {
if (e.getMessage().contains("invalid armor")) {
// We falsely assumed the data to be armored.
LOGGER.debug("The message is apparently not armored.");
bufferedIn.reset();
inputStream = bufferedIn;
} else {

View File

@ -0,0 +1,12 @@
<configuration>
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<encoder>
<pattern>%blue(%-5level) %green(%logger{35}) - %msg %n</pattern>
</encoder>
</appender>
<logger name="org.apache" level="INFO ">
<appender-ref ref="STDERR"/>
</logger>
</configuration>

View File

@ -15,6 +15,8 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testImplementation 'ch.qos.logback:logback-classic:1.2.5'
}
test {