reduce logs for non-debug runtime
This commit is contained in:
1 parent
5103d87211
commit
d66be97922
39 files changed
+182
-31
No files matched your search
@@ -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)) }
|
||||
|
||||
Reference in new issue
Block a user