Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion id/src/main/java/com/simprints/id/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.simprints.core.tools.extentions.deviceHardwareId
import com.simprints.core.tools.utils.LanguageHelper
import com.simprints.infra.enrolment.records.repository.local.migration.RealmToRoomMigrationScheduler
import com.simprints.infra.eventsync.BuildConfig.DB_ENCRYPTION
import com.simprints.infra.logging.LoggingConstants.CrashReportTag.APPLICATION
import com.simprints.infra.logging.LoggingConstants.CrashReportingCustomKeys.DEVICE_ID
import com.simprints.infra.logging.Simber
import com.simprints.infra.logging.SimberBuilder
Expand All @@ -31,7 +32,8 @@ open class Application :
@Inject
lateinit var syncOrchestrator: SyncOrchestrator

@Inject lateinit var realmToRoomMigrationScheduler: RealmToRoomMigrationScheduler
@Inject
lateinit var realmToRoomMigrationScheduler: RealmToRoomMigrationScheduler

@AppScope
@Inject
Expand All @@ -45,10 +47,22 @@ open class Application :

override fun onCreate() {
super.onCreate()
Simber.i("Application created", tag = APPLICATION)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this make the logs too noisy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once per process creation should be fine.

initApplication()
}

override fun onLowMemory() {
super.onLowMemory()
Simber.i("Low memory", tag = APPLICATION)
}

override fun onTrimMemory(level: Int) {
Simber.i("Trim memory: $level", tag = APPLICATION)
super.onTrimMemory(level)
}

override fun onTerminate() {
Simber.i("Application terminated", tag = APPLICATION)
super.onTerminate()
appScope.cancel()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ object LoggingConstants {
MIGRATION,
REALM_DB_MIGRATION,
SAMPLE_UPLOAD,
APPLICATION,
}

// Tags eligible for Firebase Analytics logging
Expand Down