reduce logs for non-debug runtime

This commit is contained in:
kulikov0 committed 2026-07-25 09:15:10 +02:00
1 parent 5103d87211
commit d66be97922
39 files changed
+182 -31

No files matched your search

Binary file not shown.
@@ -76,6 +76,7 @@ class RelayController(
return@Thread
}
try {
Androidbind.setDebug(Prefs.debug)
Androidbind.startJoiner(Ports.DC_WS, Prefs.socksPort, Prefs.socksHost, SocksAuth.user, SocksAuth.pass, cb)
} catch (e: Exception) {
if (isRunning) onLog("Relay error: ${e.message}")
@@ -99,7 +100,7 @@ class RelayController(
return@Thread
}
try {
val pb = ProcessBuilder(
val cmd = mutableListOf(
relayBin.absolutePath,
"--mode", relayMode,
"--ws-port", "${Ports.PION_SIGNALING}",
@@ -108,6 +109,8 @@ class RelayController(
"--socks-user", SocksAuth.user,
"--socks-pass", SocksAuth.pass
)
if (Prefs.debug) cmd.add("--debug")
val pb = ProcessBuilder(cmd)
pb.redirectErrorStream(true)
val proc = pb.start()
synchronized(this) { pionProcess = proc }
@@ -145,6 +145,9 @@ class SettingsScreenFragment : Fragment(R.layout.fragment_settings_screen) {
addSwitchRow(card, R.drawable.ic_setting_reconnect, getString(R.string.settings_row_reconnect), getString(R.string.settings_row_reconnect_sub), Prefs.connectOnStart) { checked ->
Prefs.connectOnStart = checked
}
addSwitchRow(card, R.drawable.ic_setting_debug, getString(R.string.settings_row_debug), getString(R.string.settings_row_debug_sub), Prefs.debug) { checked ->
Prefs.debug = checked
}
return section
}
@@ -67,6 +67,7 @@ object PrefsKeys {
const val VP8_BATCH = "vp8_batch"
const val DUAL_TRACK = "dual_track"
const val RELIABLE = "reliable"
const val DEBUG = "debug"
const val SAVED_DESTINATIONS = "saved_destinations"
const val ACTIVE_DESTINATION_ID = "active_destination_id"
const val THEME_MODE = "theme_mode"
@@ -123,6 +123,10 @@ object Prefs {
get() = prefs.getBoolean(PrefsKeys.RELIABLE, false)
set(value) = prefs.edit { putBoolean(PrefsKeys.RELIABLE, value) }
var debug: Boolean
get() = prefs.getBoolean(PrefsKeys.DEBUG, false)
set(value) = prefs.edit { putBoolean(PrefsKeys.DEBUG, value) }
var savedDestinations: List<CallConfig>
get() = CallConfig.listFromJson(prefs.getString(PrefsKeys.SAVED_DESTINATIONS, "") ?: "")
set(value) = prefs.edit { putString(PrefsKeys.SAVED_DESTINATIONS, CallConfig.listToJson(value)) }
@@ -0,0 +1,26 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:strokeColor="@android:color/white"
android:strokeWidth="1.8"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:fillColor="@android:color/transparent"
android:pathData="M4,6 L20,6 C20.55,6 21,6.45 21,7 L21,17 C21,17.55 20.55,18 20,18 L4,18 C3.45,18 3,17.55 3,17 L3,7 C3,6.45 3.45,6 4,6 Z" />
<path
android:strokeColor="@android:color/white"
android:strokeWidth="1.8"
android:strokeLineCap="round"
android:strokeLineJoin="round"
android:fillColor="@android:color/transparent"
android:pathData="M7,10 L10,12.5 L7,15" />
<path
android:strokeColor="@android:color/white"
android:strokeWidth="1.8"
android:strokeLineCap="round"
android:fillColor="@android:color/transparent"
android:pathData="M13,15 L17,15" />
</vector>
@@ -114,6 +114,8 @@
<string name="settings_row_headless_sub">Skip the visible browser join</string>
<string name="settings_row_reconnect">Reconnect on app start</string>
<string name="settings_row_reconnect_sub">Restore the last session automatically</string>
<string name="settings_row_debug">Debug logging</string>
<string name="settings_row_debug_sub">Verbose relay logs for troubleshooting</string>
<string name="settings_toast_destinations_cleared">All calls removed</string>
<string name="settings_toast_reset_done">Settings reset</string>