Skip to content

Commit ba54836

Browse files
committed
Remove excessive logs
1 parent 875bbb3 commit ba54836

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal class PowerSyncDatabaseImpl(
8181

8282
private val resource = activeDatabaseGroup.first
8383

84-
private val internalDb = InternalDatabaseImpl(pool, logger)
84+
private val internalDb = InternalDatabaseImpl(pool)
8585

8686
internal val bucketStorage: BucketStorage = BucketStorageImpl(internalDb, logger)
8787

core/src/commonMain/kotlin/com/powersync/db/internal/InternalDatabaseImpl.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.powersync.db.internal
22

3-
import co.touchlab.kermit.Logger
43
import com.powersync.ExperimentalPowerSyncAPI
54
import com.powersync.db.SqlCursor
65
import com.powersync.db.ThrowableLockCallback
@@ -11,7 +10,6 @@ import com.powersync.db.runWrapped
1110
import com.powersync.utils.AtomicMutableSet
1211
import com.powersync.utils.JsonUtil
1312
import com.powersync.utils.throttle
14-
import kotlinx.atomicfu.atomic
1513
import kotlinx.coroutines.Dispatchers
1614
import kotlinx.coroutines.IO
1715
import kotlinx.coroutines.flow.Flow
@@ -27,7 +25,6 @@ import kotlin.time.Duration.Companion.milliseconds
2725
@OptIn(ExperimentalPowerSyncAPI::class)
2826
internal class InternalDatabaseImpl(
2927
private val pool: SQLiteConnectionPool,
30-
private val logger: Logger,
3128
) : InternalDatabase {
3229
// Could be scope.coroutineContext, but the default is GlobalScope, which seems like a bad idea. To discuss.
3330
private val dbContext = Dispatchers.IO
@@ -118,13 +115,10 @@ internal class InternalDatabaseImpl(
118115
triggerImmediately: Boolean,
119116
): Flow<Set<String>> =
120117
flow {
121-
val id = debugFlowId.getAndIncrement()
122118
val batchedUpdates = AtomicMutableSet<String>()
123119

124120
updatesOnTables()
125121
.onSubscription {
126-
logger.v { "rawChangedTables($id): Start with $tableNames" }
127-
128122
if (triggerImmediately) {
129123
// Emit an initial event (if requested). No changes would be detected at this point
130124
emit(initialUpdateSentinel)
@@ -149,9 +143,7 @@ internal class InternalDatabaseImpl(
149143
.throttle(throttleMs.milliseconds)
150144
.collect {
151145
val entries = batchedUpdates.toSetAndClear()
152-
logger.v { "rawChangedTables($id): Emitting with $entries" }
153146
emit(entries)
154-
logger.v { "rawChangedTables($id): Done emitting" }
155147
}
156148
}
157149

@@ -267,7 +259,6 @@ internal class InternalDatabaseImpl(
267259

268260
private companion object {
269261
val initialUpdateSentinel = emptySet<String>()
270-
private val debugFlowId = atomic(0L)
271262
}
272263
}
273264

0 commit comments

Comments
 (0)