diff options
| author | Albin <albin@mullvad.net> | 2024-06-25 16:46:31 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-06-26 12:59:29 +0200 |
| commit | cee8176be4cae9cc605cca5ffae85d243adc4f3a (patch) | |
| tree | d989a1aa16b26b1245c65f849b6f1f03e14faba0 /android/test/common | |
| parent | 0316f672c58f5558ce9880af698098c3718591b6 (diff) | |
| download | mullvadvpn-cee8176be4cae9cc605cca5ffae85d243adc4f3a.tar.xz mullvadvpn-cee8176be4cae9cc605cca5ffae85d243adc4f3a.zip | |
Migrate log calls to kermit
Diffstat (limited to 'android/test/common')
| -rw-r--r-- | android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/rule/CaptureScreenshotOnFailedTestRule.kt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/rule/CaptureScreenshotOnFailedTestRule.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/rule/CaptureScreenshotOnFailedTestRule.kt index 9138982a43..2018714e09 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/rule/CaptureScreenshotOnFailedTestRule.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/rule/CaptureScreenshotOnFailedTestRule.kt @@ -7,9 +7,9 @@ import android.os.Build import android.os.Environment import android.os.Environment.DIRECTORY_PICTURES import android.provider.MediaStore -import android.util.Log import androidx.annotation.RequiresApi import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation +import co.touchlab.kermit.Logger import java.io.File import java.io.FileOutputStream import java.io.IOException @@ -22,7 +22,7 @@ import org.junit.jupiter.api.extension.TestWatcher class CaptureScreenshotOnFailedTestRule(private val testTag: String) : TestWatcher { override fun testFailed(context: ExtensionContext, cause: Throwable) { - Log.d(testTag, "Capturing screenshot of failed test: " + context.requiredTestMethod.name) + Logger.d("Capturing screenshot of failed test: " + context.requiredTestMethod.name) val timestamp = OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS) val screenshotName = "$timestamp-${context.requiredTestMethod.name}.jpeg" captureScreenshot(testTag, screenshotName) @@ -71,12 +71,12 @@ class CaptureScreenshotOnFailedTestRule(private val testTag: String) : TestWatch try { this.compress(Bitmap.CompressFormat.JPEG, 50, it!!) } catch (e: IOException) { - Log.e(testTag, "Unable to store screenshot: ${e.message}") + Logger.e("Unable to store screenshot: ${e.message}") } } contentResolver.update(uri, contentValues, null, null) } else { - Log.e(testTag, "Unable to store screenshot") + Logger.e("Unable to store screenshot") } } @@ -101,7 +101,7 @@ class CaptureScreenshotOnFailedTestRule(private val testTag: String) : TestWatch try { this.compress(Bitmap.CompressFormat.JPEG, 50, outputStream) } catch (e: IOException) { - Log.e(testTag, "Unable to store screenshot: ${e.message}") + Logger.e("Unable to store screenshot: ${e.message}") } } contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues) |
