Skip to content

Commit 67fdf40

Browse files
committed
feat: cleanup logging now that it's persisted
1 parent 050b1c9 commit 67fdf40

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/PretixModules.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import eu.pretix.libpretixsync.sync.FileStorage
1515
import eu.pretix.scan.tickets.data.PrintLayoutFetcher
1616
import org.koin.core.module.Module
1717
import org.koin.dsl.module
18+
import java.util.logging.Logger
19+
20+
private val log = Logger.getLogger("PretixModules")
1821

1922

2023
val pretixModules: List<Module>
@@ -48,13 +51,13 @@ val pretixModules: List<Module>
4851
val appCache = get<AppCache>()
4952

5053
if (config.proxyMode) {
51-
println("Resolving TicketCheckProvider in proxy mode")
54+
log.info("Resolving TicketCheckProvider in proxy mode")
5255
ProxyCheckProvider(config, get<HttpClientFactory>())
5356
} else if (config.offlineMode) {
54-
println("Resolving TicketCheckProvider in offline mode")
57+
log.info("Resolving TicketCheckProvider in offline mode")
5558
AsyncCheckProvider(config, appCache.db)
5659
} else {
57-
println("Resolving TicketCheckProvider in online mode")
60+
log.info("Resolving TicketCheckProvider in online mode")
5861
OnlineCheckProvider(
5962
config,
6063
get<HttpClientFactory>(),

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/desktop/app/sync/SyncProgressView.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ fun SyncedTimeAgo(never: Boolean, daysAgo: Int, hoursAgo: Int, minutesAgo: Int)
8383
}
8484

8585
statusHelper.isDaysAgo() -> {
86-
println("days ago ${statusHelper.daysAgo()}")
8786
Text(
8887
pluralStringResource(
8988
Res.plurals.sync_status_time_days,

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/desktop/app/sync/SyncRoot.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ fun SyncRoot(
3636
}
3737

3838
val showMainSyncProgress by viewModel.showMainSyncProgress.collectAsState()
39-
println("Current sync state: $syncState")
4039

4140
Box(Modifier.fillMaxSize()) {
4241
// render child content

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/desktop/app/ui/SimpleComboBox.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,6 @@ fun MenuScope.MenuContent(
328328
.startsWith(char.lowercase()))
329329
}
330330
if (matchingOption != null) {
331-
val matchIndex = menuState.options.indexOf(matchingOption)
332-
println("found match for $char at index ${matchIndex} for label ${matchingOption.label} and value ${matchingOption.value}, requesting focus")
333331
menuState.focusItem(matchingOption)
334332
true
335333
} else false

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/scan/main/presentation/MainViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MainViewModel(
3434
val eventButtonTooltip = _eventButtonTooltip.asStateFlow()
3535

3636
init {
37-
println("Welcome to app version ${Version.version}. Current scan type is ${appConfig.scanType}.")
37+
log.info("Welcome to app version ${Version.version}. Current scan type is ${appConfig.scanType}.")
3838

3939
uiState
4040
.onEach { state ->

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/scan/tickets/data/ConnectivityHelper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import eu.pretix.libpretixsync.sync.SyncManager
44

55
class ConnectivityHelper : SyncManager.CheckConnectivityFeedback {
66
override fun recordError() {
7-
println("TODO: implement recording this error.")
7+
// TODO: implement recording this error
88
}
99

1010
override fun recordSuccess(durationInMillis: Long?) {
11-
println("TODO: implement recording this success.")
11+
// TODO: implement recording this success
1212
}
1313

1414
}

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/scan/tickets/data/TicketCodeHandler.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
1919
import org.jetbrains.compose.resources.getString
2020
import pretixscan.composeapp.generated.resources.*
2121
import java.text.SimpleDateFormat
22+
import java.util.logging.Logger
2223

2324
@OptIn(ExperimentalResourceApi::class)
2425
class TicketCodeHandler(
@@ -30,6 +31,7 @@ class TicketCodeHandler(
3031
private val connectivityHelper: ConnectivityHelper,
3132
private val layoutFetcher: PrintLayoutFetcher
3233
) {
34+
private val log = Logger.getLogger("TicketCodeHandler")
3335

3436
suspend fun handleScanResult(
3537
rawResult: String?,
@@ -128,7 +130,7 @@ class TicketCodeHandler(
128130
allowQuestions = allowQuestions
129131
)
130132

131-
println("Check result type: ${checkResult.type}")
133+
log.info("Check result type: ${checkResult.type}")
132134

133135
if (checkProvider is OnlineCheckProvider) {
134136
if (checkResult.type == TicketCheckProvider.CheckResult.Type.ERROR) {

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/scan/tickets/presentation/QuestionsDialogViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class QuestionsDialogViewModel(private val config: DataStoreConfigStore) : ViewM
191191
fun updateChoiceAnswer(questionId: Long, value: String, checked: Boolean?) {
192192
_form.value = _form.value.map { field ->
193193
if (field.id == questionId && field.fieldType == QuestionType.M) {
194-
log.info("Updating choices for $questionId (${field.fieldType}) value:checked $value:$checked")
194+
log.info("Updating choices for $questionId (${field.fieldType})")
195195
when (checked) {
196196
true -> {
197197
val updatedValues = (field.values?.toList()?.toMutableList()
@@ -211,7 +211,7 @@ class QuestionsDialogViewModel(private val config: DataStoreConfigStore) : ViewM
211211
fun updateAnswer(questionId: Long, answer: String?, extra: String? = null) {
212212
_form.value = _form.value.map { field ->
213213
if (field.id == questionId) {
214-
log.info("Updating answer for $questionId (${field.fieldType}) to $answer, extra: $extra")
214+
log.info("Updating answer for $questionId (${field.fieldType})")
215215

216216
when (field.fieldType) {
217217
QuestionType.F -> {
@@ -284,7 +284,7 @@ class QuestionsDialogViewModel(private val config: DataStoreConfigStore) : ViewM
284284
}
285285
}
286286
_form.value.forEach { field ->
287-
log.info("question ${field.label}: ${field.value}, valid: ${if (field.validation == null) "yes" else "${field.validation}"}")
287+
log.info("question ${field.label}, valid: ${if (field.validation == null) "yes" else "${field.validation}"}")
288288
}
289289
}
290290

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/scan/tickets/presentation/SearchResultsView.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ fun SearchResultsView(
6464
) {
6565
itemsIndexed(searchSuggestions) { index, item ->
6666
FocusableRowItem(index, item, onSelectedSearchResult, onFocused = {
67-
println("Focused row $index")
6867
focusedIndex.value = index
6968
}, focusedIndex = focusedIndex.value)
7069
}

pretixscan/composeApp/src/commonMain/kotlin/eu/pretix/scan/tickets/presentation/TicketHandlingDialogViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TicketHandlingDialogViewModel(
2626
}
2727

2828
suspend fun handleTicket(secret: String?, answers: List<Answer>? = null, ignoreUnpaid: Boolean = false) {
29-
log.info("Handling ticket $secret")
29+
log.info("Handling ticket")
3030
_uiState.update {
3131
ResultStateData(resultState = ResultState.LOADING)
3232
}

0 commit comments

Comments
 (0)