Replace e.printStackTrace() with Log.w in PhotoSaver

EXIF write failures are non-critical (the photo is already saved)
but should still be visible in logcat. Use Log.w with a proper TAG
instead of printStackTrace().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-02-27 15:22:04 +01:00
commit ef350e9fb7

View file

@ -11,6 +11,7 @@ import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import android.util.Log
import androidx.exifinterface.media.ExifInterface
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@ -33,6 +34,10 @@ sealed class SaveResult {
*/
class PhotoSaver(private val context: Context) {
companion object {
private const val TAG = "PhotoSaver"
}
private val exifWriter = ExifWriter()
private val fileNameFormat = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US)
@ -169,7 +174,7 @@ class PhotoSaver(private val context: Context) {
exif.saveAttributes()
}
} catch (e: Exception) {
e.printStackTrace()
Log.w(TAG, "Failed to write EXIF data", e)
}
}