- Only show baresip lib debug messages when Debug has been enabled.

This commit is contained in:
Juha Heinanen
2020-02-21 02:58:49 +02:00
parent 336bfa1ceb
commit a888c0cac8
3 changed files with 8 additions and 6 deletions
@@ -304,7 +304,7 @@ class BaresipService: Service() {
if ((ipV4Addr == "") && (ipV6Addr == ""))
Log.w(LOG_TAG, "Starting baresip without IP addresses")
Thread(Runnable { baresipStart(filesPath, ipV4Addr, ipV6Addr, "",
Api.AF_UNSPEC)
Api.AF_UNSPEC, logLevel)
}).start()
isServiceRunning = true
@@ -1058,7 +1058,7 @@ class BaresipService: Service() {
}
external fun baresipStart(path: String, ipV4Addr: String, ipV6Addr: String, netInterface: String,
netAf: Int)
netAf: Int, logLevel: Int)
external fun baresipStop(force: Boolean)
companion object {
@@ -1092,6 +1092,7 @@ class BaresipService: Service() {
var netInterface = ""
var filesPath = ""
var downloadsPath = ""
var logLevel = 2
val uas = ArrayList<UserAgent>()
val status = ArrayList<Int>()
@@ -49,12 +49,13 @@ object Config {
if (!config.contains("log_level")) {
config = "${config}log_level 2\n"
Api.log_level_set(2)
Log.logLevel = Log.LogLevel.WARN
BaresipService.logLevel = 2
} else {
val ll = variable("log_level")[0].toInt()
Api.log_level_set(ll)
replaceVariable("log_level", "$ll")
Log.logLevelSet(ll)
BaresipService.logLevel = ll
}
if (config.contains("net_interface")) {