11package org.schabi.newpipe.settings
22
33import android.content.SharedPreferences
4+ import android.util.Log
45import org.schabi.newpipe.streams.io.SharpOutputStream
56import org.schabi.newpipe.streams.io.StoredFileHelper
67import org.schabi.newpipe.util.ZipHelper
@@ -13,6 +14,9 @@ import java.io.ObjectOutputStream
1314import java.util.zip.ZipOutputStream
1415
1516class ContentSettingsManager (private val fileLocator : NewPipeFileLocator ) {
17+ companion object {
18+ const val TAG = " ContentSetManager"
19+ }
1620
1721 /* *
1822 * Exports given [SharedPreferences] to the file in given outputPath.
@@ -31,7 +35,7 @@ class ContentSettingsManager(private val fileLocator: NewPipeFileLocator) {
3135 output.flush()
3236 }
3337 } catch (e: IOException ) {
34- e.printStackTrace( )
38+ Log .e( TAG , " Unable to exportDatabase " , e )
3539 }
3640
3741 ZipHelper .addFileToZip(outZip, fileLocator.settings.path, " newpipe.settings" )
@@ -101,9 +105,9 @@ class ContentSettingsManager(private val fileLocator: NewPipeFileLocator) {
101105 preferenceEditor.commit()
102106 }
103107 } catch (e: IOException ) {
104- e.printStackTrace( )
108+ Log .e( TAG , " Unable to loadSharedPreferences " , e )
105109 } catch (e: ClassNotFoundException ) {
106- e.printStackTrace( )
110+ Log .e( TAG , " Unable to loadSharedPreferences " , e )
107111 }
108112 }
109113}
0 commit comments