Determine directory from logback
This commit is contained in:
parent
9b020f68db
commit
72e8e5fd05
2 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
<configuration>
|
||||
<!-- Create a file appender for a log in the application's data directory -->
|
||||
<property name="EXT_FILES_DIR" value="${EXT_DIR:-/sdcard}/Android/data/${PACKAGE_NAME}/files"/>
|
||||
<property scope="context" name="EXT_FILES_DIR" value="${EXT_DIR:-/sdcard}/Android/data/${PACKAGE_NAME}/files"/>
|
||||
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${EXT_FILES_DIR}/AndroidAPS.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import info.nightscout.androidaps.Services.Intents;
|
||||
import info.nightscout.androidaps.db.DatabaseHelper;
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface;
|
||||
|
@ -201,7 +202,9 @@ public class MainApp extends Application {
|
|||
}
|
||||
}).start();
|
||||
|
||||
File engineeringModeSemaphore = new File(System.getProperty("EXT_FILES_DIR"),"engineering_mode");
|
||||
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
String extFilesDir = lc.getProperty("EXT_FILES_DIR");
|
||||
File engineeringModeSemaphore = new File(extFilesDir,"engineering_mode");
|
||||
|
||||
engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile();
|
||||
devBranch = BuildConfig.VERSION.contains("dev");
|
||||
|
|
Loading…
Reference in a new issue