mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
provide framework for application logging
This commit is contained in:
parent
3a853e2ab1
commit
10c1574a4a
3 changed files with 21 additions and 1 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
||||||
Subproject commit c084a0de7e92bbc500234e66dcec690475ac9121
|
Subproject commit 5b2e21b3d7cc5d6dff730baeec5efbb419f3555c
|
12
src/main/java/com/sparrowwallet/sparrow/TorLogHandler.java
Normal file
12
src/main/java/com/sparrowwallet/sparrow/TorLogHandler.java
Normal 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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -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" />
|
||||||
|
|
Loading…
Reference in a new issue