android: guard against potential exceptions when dealing with log handlers

pull/4953/head
Saúl Ibarra Corretgé 5 years ago committed by Saúl Ibarra Corretgé
parent e69da98348
commit a79ae9b576
  1. 17
      android/sdk/src/main/java/org/jitsi/meet/sdk/log/JitsiMeetLogger.java

@ -24,11 +24,24 @@ public class JitsiMeetLogger {
}
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) {
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) {

Loading…
Cancel
Save