provide framework for application logging

This commit is contained in:
Craig Raw 2021-03-08 09:18:22 +02:00
parent 3a853e2ab1
commit 10c1574a4a
3 changed files with 21 additions and 1 deletions

2
drongo

@ -1 +1 @@
Subproject commit c084a0de7e92bbc500234e66dcec690475ac9121 Subproject commit 5b2e21b3d7cc5d6dff730baeec5efbb419f3555c

View file

@ -0,0 +1,12 @@
package com.sparrowwallet.sparrow;
import com.sparrowwallet.drongo.LogHandler;
import com.sparrowwallet.sparrow.event.TorStatusEvent;
import org.slf4j.event.Level;
public class TorLogHandler implements LogHandler {
@Override
public void handleLog(String threadName, Level level, String message, String loggerName, long timestamp, StackTraceElement[] callerData) {
EventManager.get().post(new TorStatusEvent(message));
}
}

View file

@ -22,6 +22,14 @@
</encoder> </encoder>
</appender> </appender>
<appender name="APPLICATION_TOR" class="com.sparrowwallet.drongo.ApplicationAppender">
<callback>com.sparrowwallet.sparrow.TorLogHandler</callback>
</appender>
<logger name="org.berndpruenster.netlayer.tor" level="debug" additivity="false">
<appender-ref ref="APPLICATION_TOR" />
</logger>
<root level="info"> <root level="info">
<appender-ref ref="FILE" /> <appender-ref ref="FILE" />
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />