mirror of
https://github.com/etesync/android
synced 2025-06-26 18:02:39 +00:00
Improve logging in syncmanager and import.
This commit is contained in:
parent
8d660e376a
commit
bc829d0d1e
@ -129,6 +129,7 @@ constructor(protected val context: Context, protected val account: Account, prot
|
|||||||
syncPhase = R.string.sync_phase_prepare_local
|
syncPhase = R.string.sync_phase_prepare_local
|
||||||
Logger.log.info("Sync phase: " + context.getString(syncPhase))
|
Logger.log.info("Sync phase: " + context.getString(syncPhase))
|
||||||
prepareLocal()
|
prepareLocal()
|
||||||
|
Logger.log.info("Locally changed: (dirty=${localDirty.size} deleted=${localDeleted?.size}")
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (Thread.interrupted())
|
if (Thread.interrupted())
|
||||||
|
@ -93,6 +93,7 @@ class ImportFragment : DialogFragment() {
|
|||||||
private fun setDialogAddEntries(dialog: ProgressDialog, length: Int) {
|
private fun setDialogAddEntries(dialog: ProgressDialog, length: Int) {
|
||||||
dialog.max = length
|
dialog.max = length
|
||||||
dialog.setMessage(getString(R.string.import_dialog_adding_entries))
|
dialog.setMessage(getString(R.string.import_dialog_adding_entries))
|
||||||
|
Logger.log.info("Adding entries. Total: ${length}")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
@ -144,7 +145,7 @@ class ImportFragment : DialogFragment() {
|
|||||||
if (data != null) {
|
if (data != null) {
|
||||||
// Get the URI of the selected file
|
// Get the URI of the selected file
|
||||||
val uri = data.data!!
|
val uri = data.data!!
|
||||||
Logger.log.info("Importing uri = ${uri}")
|
Logger.log.info("Starting import into ${info.uid} from file ${uri}")
|
||||||
try {
|
try {
|
||||||
inputStream = activity!!.contentResolver.openInputStream(uri)
|
inputStream = activity!!.contentResolver.openInputStream(uri)
|
||||||
|
|
||||||
@ -172,6 +173,8 @@ class ImportFragment : DialogFragment() {
|
|||||||
fun loadFinished(data: ImportResult) {
|
fun loadFinished(data: ImportResult) {
|
||||||
(activity as ResultFragment.OnImportCallback).onImportResult(data)
|
(activity as ResultFragment.OnImportCallback).onImportResult(data)
|
||||||
|
|
||||||
|
Logger.log.info("Finished import")
|
||||||
|
|
||||||
dismissAllowingStateLoss()
|
dismissAllowingStateLoss()
|
||||||
|
|
||||||
if (activity is Refreshable) {
|
if (activity is Refreshable) {
|
||||||
|
Loading…
Reference in New Issue
Block a user