Log GB's version

This commit is contained in:
cpfeiffer 2015-10-03 22:30:11 +02:00
parent 0a7366e458
commit 2231dcbce3
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}