diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2020-04-21 13:30:42 +0530 |
|---|---|---|
| committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-04-21 15:55:26 +0530 |
| commit | 500ab609737c9f297962ed6a1cd935a27f39517d (patch) | |
| tree | 56e93788cbc350b3f3bcaf27686ddb25c1faa7d1 /app/src/main/java/com/zeapo/pwdstore/crypto | |
| parent | 72166c6912ea596e5087e553c64bfc5dd9ed3742 (diff) | |
| download | HardenedPass-500ab609737c9f297962ed6a1cd935a27f39517d.tar.gz HardenedPass-500ab609737c9f297962ed6a1cd935a27f39517d.zip | |
treewide: switch to logging via timberkt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/crypto')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index 3d8ef1a7..f6d2b169 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -38,6 +38,9 @@ import androidx.core.widget.doOnTextChanged import androidx.lifecycle.lifecycleScope import androidx.localbroadcastmanager.content.LocalBroadcastManager import androidx.preference.PreferenceManager +import com.github.ajalt.timberkt.Timber.e +import com.github.ajalt.timberkt.Timber.i +import com.github.ajalt.timberkt.Timber.tag import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.snackbar.Snackbar import com.zeapo.pwdstore.ClipboardService @@ -71,7 +74,6 @@ import org.apache.commons.io.FileUtils import org.apache.commons.io.FilenameUtils import org.openintents.openpgp.IOpenPgpService2 import org.openintents.openpgp.OpenPgpError -import timber.log.Timber class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { private val clipboard by lazy { getSystemService<ClipboardManager>() } @@ -116,7 +118,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE) - Timber.tag(TAG) + tag(TAG) // some persistence _keyIDs = settings.getStringSet("openpgp_key_ids_set", null) ?: emptySet() @@ -318,7 +320,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { * @param requestCode The code we'd like to use to identify the behaviour */ private fun handleUserInteractionRequest(result: Intent, requestCode: Int) { - Timber.i("RESULT_CODE_USER_INTERACTION_REQUIRED") + i { "RESULT_CODE_USER_INTERACTION_REQUIRED" } val pi: PendingIntent? = result.getParcelableExtra(RESULT_INTENT) try { @@ -327,7 +329,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { null, 0, 0, 0 ) } catch (e: IntentSender.SendIntentException) { - Timber.e(e, "SendIntentException") + e(e) { "SendIntentException" } } } @@ -346,8 +348,8 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { val error: OpenPgpError? = result.getParcelableExtra(RESULT_ERROR) if (error != null) { showSnackbar("Error from OpenKeyChain : " + error.message) - Timber.e("onError getErrorId: ${error.errorId}") - Timber.e("onError getMessage: ${error.message}") + e { "onError getErrorId: ${error.errorId}" } + e { "onError getMessage: ${error.message}" } } } @@ -524,7 +526,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { copyPasswordToClipBoard() } } catch (e: Exception) { - Timber.e(e, "An Exception occurred") + e(e) { "An Exception occurred" } } } RESULT_CODE_USER_INTERACTION_REQUIRED -> handleUserInteractionRequest(result, REQUEST_DECRYPT) @@ -624,7 +626,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { setResult(RESULT_OK, returnIntent) finish() } catch (e: Exception) { - Timber.e(e, "An Exception occurred") + e(e) { "An Exception occurred" } } } RESULT_CODE_ERROR -> handleError(result) @@ -730,7 +732,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { setResult(RESULT_OK) finish() } catch (e: Exception) { - Timber.e(e, "An Exception occurred") + e(e) { "An Exception occurred" } } } RESULT_CODE_USER_INTERACTION_REQUIRED -> handleUserInteractionRequest(result, REQUEST_KEY_ID) |
