mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-22 20:32:05 +01:00
Wip: Configure logback logging
This commit is contained in:
parent
4d6ca80e25
commit
1124c6fd15
5 changed files with 30 additions and 0 deletions
|
@ -36,6 +36,8 @@ dependencies {
|
||||||
// https://todd.ginsberg.com/post/testing-system-exit/
|
// https://todd.ginsberg.com/post/testing-system-exit/
|
||||||
testImplementation 'com.ginsberg:junit5-system-exit:1.1.1'
|
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"
|
implementation "org.bouncycastle:bcprov-debug-jdk15on:$bouncyCastleVersion"
|
||||||
/*/
|
/*/
|
||||||
|
|
12
pgpainless-cli/src/main/resources/logback.xml
Normal file
12
pgpainless-cli/src/main/resources/logback.xml
Normal 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>
|
|
@ -134,11 +134,13 @@ public final class DecryptionStreamFactory {
|
||||||
// Not an OpenPGP message.
|
// Not an OpenPGP message.
|
||||||
// Reset the buffered stream to parse the message as arbitrary binary data
|
// Reset the buffered stream to parse the message as arbitrary binary data
|
||||||
// to allow for detached signature verification.
|
// 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();
|
bufferedIn.reset();
|
||||||
inputStream = bufferedIn;
|
inputStream = bufferedIn;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (e.getMessage().contains("invalid armor")) {
|
if (e.getMessage().contains("invalid armor")) {
|
||||||
// We falsely assumed the data to be armored.
|
// We falsely assumed the data to be armored.
|
||||||
|
LOGGER.debug("The message is apparently not armored.");
|
||||||
bufferedIn.reset();
|
bufferedIn.reset();
|
||||||
inputStream = bufferedIn;
|
inputStream = bufferedIn;
|
||||||
} else {
|
} else {
|
||||||
|
|
12
pgpainless-core/src/main/resources/logback.xml
Normal file
12
pgpainless-core/src/main/resources/logback.xml
Normal 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>
|
|
@ -15,6 +15,8 @@ dependencies {
|
||||||
|
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
||||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
||||||
|
|
||||||
|
testImplementation 'ch.qos.logback:logback-classic:1.2.5'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
Loading…
Reference in a new issue