Log GB's version
This commit is contained in:
parent
0a7366e458
commit
2231dcbce3
|
@ -77,6 +77,7 @@ public class GBApplication extends Application {
|
|||
File dir = FileUtils.getExternalFilesDir();
|
||||
// used by assets/logback.xml since the location cannot be statically determined
|
||||
System.setProperty("GB_LOGFILES_DIR", dir.getAbsolutePath());
|
||||
getLogger().info("Gadgetbridge version: " + BuildConfig.VERSION_NAME);
|
||||
} catch (IOException ex) {
|
||||
Log.e("GBApplication", "External files dir not available, cannot log to file, ex");
|
||||
System.setProperty("GB_LOGFILES_DIR", "/dev/null");
|
||||
|
@ -92,6 +93,10 @@ public class GBApplication extends Application {
|
|||
}
|
||||
}
|
||||
|
||||
private Logger getLogger() {
|
||||
return LoggerFactory.getLogger(GBApplication.class);
|
||||
}
|
||||
|
||||
public static Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue