1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

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 {