mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-25 09:36:44 +00:00
platform specific log file location support
This commit is contained in:
parent
17773f783e
commit
274fb9afc3
2 changed files with 22 additions and 0 deletions
21
src/main/java/com/sparrowwallet/drongo/PropertyDefiner.java
Normal file
21
src/main/java/com/sparrowwallet/drongo/PropertyDefiner.java
Normal file
|
@ -0,0 +1,21 @@
|
|||
package com.sparrowwallet.drongo;
|
||||
|
||||
import ch.qos.logback.core.PropertyDefinerBase;
|
||||
|
||||
public class PropertyDefiner extends PropertyDefinerBase {
|
||||
private String application;
|
||||
|
||||
public void setApplication(String application) {
|
||||
this.application = application;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPropertyValue() {
|
||||
return isWindows() ? System.getenv("APPDATA") + "/" + application.substring(0, 1).toUpperCase() + application.substring(1) : System.getProperty("user.home") + "/." + application;
|
||||
}
|
||||
|
||||
private boolean isWindows() {
|
||||
String osName = System.getProperty("os.name");
|
||||
return (osName != null && osName.toLowerCase().startsWith("windows"));
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ open module com.sparrowwallet.drongo {
|
|||
requires org.bouncycastle.provider;
|
||||
requires de.mkammerer.argon2;
|
||||
requires slf4j.api;
|
||||
requires logback.core;
|
||||
requires json.simple;
|
||||
requires jeromq;
|
||||
exports com.sparrowwallet.drongo;
|
||||
|
|
Loading…
Reference in a new issue