Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit 3f34e55

Browse files
AbandonedCartpixincreate
authored andcommitted
Add a flag to ignore excessive use of verbose log
1 parent 0a6db50 commit 3f34e55

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ private void initializeFirstEverAppLaunch() {
380380
Log.i(TAG, "Detected a new install that doesn't have passphrases disabled -- assuming bad initialization.");
381381
AppInitialization.onRepairFirstEverAppLaunch(this);
382382
} else if (!SignalStore.settings().getPassphraseDisabled() && VersionTracker.getDaysSinceFirstInstalled(this) < 912) {
383-
Log.i(TAG, "Detected a not-recent install that doesn't have passphrases disabled -- disabling now.");
383+
Log.i(TAG, "Detected a non-recent install that doesn't have passphrases disabled -- disabling now.");
384384
SignalStore.settings().setPassphraseDisabled(true);
385385
}
386386
}

core-util/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ plugins {
55

66
android {
77
namespace = "org.signal.core.util"
8+
9+
defaultConfig {
10+
buildConfigField("boolean", "VERBOSE_LOGGING", "false")
11+
}
812
}
913

1014
dependencies {

core-util/src/main/java/org/signal/core/util/logging/AndroidLogger.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,28 @@
44

55
import org.signal.core.util.logging.Log;
66

7+
import org.signal.core.util.BuildConfig;
8+
79
@SuppressLint("LogNotSignal")
810
public final class AndroidLogger extends Log.Logger {
911

12+
private boolean isLogVerbose() {
13+
return BuildConfig.VERBOSE_LOGGING;
14+
}
15+
1016
@Override
1117
public void v(String tag, String message, Throwable t, boolean keepLonger) {
12-
android.util.Log.v(tag, message, t);
18+
if (isLogVerbose()) android.util.Log.v(tag, message, t);
1319
}
1420

1521
@Override
1622
public void d(String tag, String message, Throwable t, boolean keepLonger) {
17-
android.util.Log.d(tag, message, t);
23+
if (isLogVerbose()) android.util.Log.d(tag, message, t);
1824
}
1925

2026
@Override
2127
public void i(String tag, String message, Throwable t, boolean keepLonger) {
22-
android.util.Log.i(tag, message, t);
28+
if (isLogVerbose()) android.util.Log.i(tag, message, t);
2329
}
2430

2531
@Override

0 commit comments

Comments
 (0)