android: guard against potential exceptions when dealing with log handlers
This commit is contained in:
parent
e69da98348
commit
a79ae9b576
|
@ -24,11 +24,24 @@ public class JitsiMeetLogger {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addHandler(JitsiMeetBaseLogHandler handler) {
|
public static void addHandler(JitsiMeetBaseLogHandler handler) {
|
||||||
Timber.plant(handler);
|
if (!Timber.forest().contains(handler)) {
|
||||||
|
try {
|
||||||
|
Timber.plant(handler);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
Timber.w(t, "Couldn't add log handler");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeHandler(JitsiMeetBaseLogHandler handler) {
|
public static void removeHandler(JitsiMeetBaseLogHandler handler) {
|
||||||
Timber.uproot(handler);
|
if (Timber.forest().contains(handler)) {
|
||||||
|
try {
|
||||||
|
Timber.uproot(handler);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
Timber.w(t, "Couldn't remove log handler");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void v(String message, Object... args) {
|
public static void v(String message, Object... args) {
|
||||||
|
|
Loading…
Reference in New Issue