mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Fix logback initialization, closes #300
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package nodomain.freeyourgadget.gadgetbridge.util;
|
package nodomain.freeyourgadget.gadgetbridge.util;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -11,7 +12,9 @@ import java.util.Set;
|
|||||||
* Wraps SharedPreferences to avoid ClassCastExceptions and others.
|
* Wraps SharedPreferences to avoid ClassCastExceptions and others.
|
||||||
*/
|
*/
|
||||||
public class Prefs {
|
public class Prefs {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(Prefs.class);
|
private static final String TAG = "Prefs";
|
||||||
|
// DO NOT use slf4j logger here, this would break its configuration via GBApplication
|
||||||
|
// private static final Logger LOG = LoggerFactory.getLogger(Prefs.class);
|
||||||
|
|
||||||
private final SharedPreferences preferences;
|
private final SharedPreferences preferences;
|
||||||
|
|
||||||
@@ -136,7 +139,7 @@ public class Prefs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logReadError(String key, Exception ex) {
|
private void logReadError(String key, Exception ex) {
|
||||||
LOG.error("Error reading preference value: " + key + "; returning default value", ex); // log the first exception
|
Log.e(TAG, "Error reading preference value: " + key + "; returning default value", ex); // log the first exception
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user