From a01482dca441cc00eabc78aea6de9bf4942037e6 Mon Sep 17 00:00:00 2001 From: onurays Date: Wed, 25 Mar 2020 18:51:55 +0300 Subject: [PATCH] Use Timber log instead of printStackTrace. --- multipicker/build.gradle | 3 +++ .../java/im/vector/riotx/multipicker/utils/ImageUtils.kt | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/multipicker/build.gradle b/multipicker/build.gradle index d8cfeee3c9..8b08a9d3ef 100644 --- a/multipicker/build.gradle +++ b/multipicker/build.gradle @@ -50,4 +50,7 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation 'androidx.exifinterface:exifinterface:1.3.0-alpha01' + + // Log + implementation 'com.jakewharton.timber:timber:4.7.1' } diff --git a/multipicker/src/main/java/im/vector/riotx/multipicker/utils/ImageUtils.kt b/multipicker/src/main/java/im/vector/riotx/multipicker/utils/ImageUtils.kt index 009418fd5c..c5171e7d84 100644 --- a/multipicker/src/main/java/im/vector/riotx/multipicker/utils/ImageUtils.kt +++ b/multipicker/src/main/java/im/vector/riotx/multipicker/utils/ImageUtils.kt @@ -23,6 +23,7 @@ import android.graphics.ImageDecoder import android.net.Uri import android.os.Build import androidx.exifinterface.media.ExifInterface +import timber.log.Timber object ImageUtils { @@ -36,7 +37,7 @@ object ImageUtils { } } } catch (e: Exception) { - e.printStackTrace() + Timber.e(e, "Cannot decode Bitmap: %s", uri.toString()) null } } @@ -49,7 +50,7 @@ object ImageUtils { orientation = it.rotationDegrees } } catch (e: Exception) { - e.printStackTrace() + Timber.e(e, "Cannot read orientation: %s", uri.toString()) } } return orientation