Updated on 2026-08-14
This commit is contained in:
commit
b5c8985ff1
4 changed files with 18 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ import com.tangem.core.navigation.url.UrlOpener
|
|||
import com.tangem.datasource.connection.NetworkConnectionManager
|
||||
import com.tangem.datasource.local.config.environment.EnvironmentConfigStorage
|
||||
import com.tangem.datasource.local.config.issuers.IssuersConfigStorage
|
||||
import com.tangem.datasource.local.logs.AppLogsStore
|
||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
||||
import com.tangem.domain.appcurrency.repository.AppCurrencyRepository
|
||||
import com.tangem.domain.apptheme.GetAppThemeModeUseCase
|
||||
|
|
@ -125,4 +126,6 @@ interface ApplicationEntryPoint {
|
|||
fun getCoroutineDispatcherProvider(): CoroutineDispatcherProvider
|
||||
|
||||
fun getExcludedBlockchains(): ExcludedBlockchains
|
||||
|
||||
fun getAppLogsStore(): AppLogsStore
|
||||
}
|
||||
|
|
@ -26,6 +26,7 @@ import com.tangem.datasource.connection.NetworkConnectionManager
|
|||
import com.tangem.datasource.local.config.environment.EnvironmentConfig
|
||||
import com.tangem.datasource.local.config.environment.EnvironmentConfigStorage
|
||||
import com.tangem.datasource.local.config.issuers.IssuersConfigStorage
|
||||
import com.tangem.datasource.local.logs.AppLogsStore
|
||||
import com.tangem.datasource.local.preferences.AppPreferencesStore
|
||||
import com.tangem.domain.appcurrency.repository.AppCurrencyRepository
|
||||
import com.tangem.domain.apptheme.GetAppThemeModeUseCase
|
||||
|
|
@ -197,12 +198,17 @@ abstract class TangemApplication : Application(), ImageLoaderFactory {
|
|||
|
||||
private val excludedBlockchains: ExcludedBlockchains
|
||||
get() = entryPoint.getExcludedBlockchains()
|
||||
|
||||
private val appLogsStore: AppLogsStore
|
||||
get() = entryPoint.getAppLogsStore()
|
||||
// endregion
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
init()
|
||||
|
||||
appLogsStore.deleteOldLogsFile()
|
||||
}
|
||||
|
||||
fun init() {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class AppLogsStore @Inject constructor(
|
|||
)
|
||||
private val mutex = Mutex()
|
||||
|
||||
private val file = File(applicationContext.filesDir, LOG_FILE_NAME)
|
||||
private val file = File(applicationContext.filesDir, NEW_LOG_FILE_NAME)
|
||||
|
||||
private val formatter = DateTimeFormatterBuilder()
|
||||
.appendDayOfMonth(2)
|
||||
|
|
@ -84,6 +84,12 @@ class AppLogsStore @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun deleteOldLogsFile() {
|
||||
val file = File(applicationContext.filesDir, LOG_FILE_NAME)
|
||||
|
||||
if (file.exists()) file.delete()
|
||||
}
|
||||
|
||||
private fun writeMessage(vararg messages: String) {
|
||||
BufferedWriter(FileWriter(file, true)).use { writer ->
|
||||
writer.append(formatter.print(DateTime.now()))
|
||||
|
|
@ -112,5 +118,6 @@ class AppLogsStore @Inject constructor(
|
|||
|
||||
private companion object {
|
||||
const val LOG_FILE_NAME = "logs.txt"
|
||||
const val NEW_LOG_FILE_NAME = "app_logs.txt"
|
||||
}
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ markdownComposeView = "0.5.4"
|
|||
# region Tangem
|
||||
tangemBlockchainSdk = "release-app_5.19-888"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "release-app_5.19-414"
|
||||
tangemCardSdk = "release-app_5.19-418"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
|
||||
tangemVico = "2.0.0-alpha.25-tangem17"
|
||||
#tangemVico = "0.0.1" # Keep it! - used for local builds ^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue