Use Timber log instead of printStackTrace.

This commit is contained in:
onurays 2020-03-25 18:51:55 +03:00
parent 5db1010e47
commit a01482dca4
2 changed files with 6 additions and 2 deletions

View file

@ -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'
}

View file

@ -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