-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add more logging on testservice and possibility to set developm…
…ent api on instance creation (#2225) * feat: add better debug info and error messages to testservice * No need to print class * Log when sync fails * Attach kalium log output from kermit logger to regular log * Log level for kalium is lower than the default * Send response on timeout * Better handling of delete instance * Put instance in collection befor sync to be able to delete more clients on failure * Fix return value * Make development api setting configurable * Fix compilation issue with logwriter * Fix SpacingAroundOperators * Use clear variables for parameters * Revert change in CoreLogger and use CoreLogger.init to attach own logger
- Loading branch information
1 parent
b29d505
commit 701778c
Showing
6 changed files
with
106 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
testservice/src/main/kotlin/com/wire/kalium/testservice/KaliumLogWriter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.kalium.testservice | ||
|
||
import co.touchlab.kermit.LogWriter | ||
import co.touchlab.kermit.Severity | ||
import com.wire.kalium.testservice.managed.InstanceService | ||
import org.slf4j.LoggerFactory | ||
|
||
class KaliumLogWriter(private val instanceId: String) : LogWriter() { | ||
|
||
private val log = LoggerFactory.getLogger(InstanceService::class.java.name) | ||
|
||
override fun log(severity: Severity, message: String, tag: String, throwable: Throwable?) { | ||
when (severity) { | ||
Severity.Verbose -> log.debug("Instance $instanceId: $message") | ||
Severity.Debug -> log.debug("Instance $instanceId: $message") | ||
Severity.Info -> log.info("Instance $instanceId: $message") | ||
Severity.Warn -> log.warn("Instance $instanceId: $message") | ||
Severity.Error -> log.error("Instance $instanceId: $message $throwable") | ||
Severity.Assert -> log.info("Instance $instanceId: $message") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters