Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Upgrade some log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Apr 24, 2024
1 parent d147ccc commit 41d3915
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Aware/macOS/ActivityMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct ActivityMonitor {
func updates() -> AsyncStream<TimerState<UTCClock>> {
AsyncStream(bufferingPolicy: .bufferingNewest(1)) { @MainActor yield in
do {
logger.info("Starting ActivityMonitor update task: \(initialState, privacy: .public)")
logger.log("Starting ActivityMonitor update task: \(initialState, privacy: .public)")

var state = initialState {
didSet {
Expand Down Expand Up @@ -108,9 +108,9 @@ struct ActivityMonitor {
assert(Task.isCancelled)
try Task.checkCancellation()

logger.info("Finished ActivityMonitor update task")
logger.log("Finished ActivityMonitor update task")
} catch is CancellationError {
logger.info("ActivityMonitor update task canceled")
logger.log("ActivityMonitor update task canceled")
} catch {
logger.error("ActivityMonitor update task canceled unexpectedly: \(error, privacy: .public)")
}
Expand Down
6 changes: 3 additions & 3 deletions Aware/macOS/MenuBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ struct TimerMenuBarLabel: View {
}
.task(id: activityMonitorConfiguration) {
let activityMonitor = ActivityMonitor(initialState: timerState, configuration: activityMonitorConfiguration)
logger.info("Starting ActivityMonitor updates task: \(timerState, privacy: .public)")
logger.log("Starting ActivityMonitor updates task: \(timerState, privacy: .public)")
for await state in activityMonitor.updates() {
logger.info("Received ActivityMonitor state: \(state, privacy: .public)")
logger.log("Received ActivityMonitor state: \(state, privacy: .public)")
timerState = state
}
logger.info("Finished ActivityMonitor updates task: \(timerState, privacy: .public)")
logger.log("Finished ActivityMonitor updates task: \(timerState, privacy: .public)")
}
.onAppear {
statusBarButton = findStatusBarItem()?.button
Expand Down
6 changes: 3 additions & 3 deletions Aware/visionOS/ActivityMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct ActivityMonitor {
func updates() -> AsyncStream<TimerState<UTCClock>> {
AsyncStream(bufferingPolicy: .bufferingNewest(1)) { @MainActor yield in
do {
logger.info("Starting ActivityMonitor update task: \(initialState)")
logger.log("Starting ActivityMonitor update task: \(initialState)")

var state = initialState {
didSet {
Expand Down Expand Up @@ -162,9 +162,9 @@ struct ActivityMonitor {
assert(Task.isCancelled)
try Task.checkCancellation()

logger.info("Finished ActivityMonitor update task")
logger.log("Finished ActivityMonitor update task")
} catch is CancellationError {
logger.info("ActivityMonitor update task canceled")
logger.log("ActivityMonitor update task canceled")
} catch {
logger.error("ActivityMonitor update task canceled unexpectedly: \(error, privacy: .public)")
}
Expand Down
3 changes: 3 additions & 0 deletions Aware/visionOS/TimerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ struct TimerView: View {
}
.task(id: activityMonitorConfiguration) {
let activityMonitor = ActivityMonitor(initialState: timerState, configuration: activityMonitorConfiguration)
logger.log("Starting ActivityMonitor updates task: \(timerState, privacy: .public)")
for await state in activityMonitor.updates() {
logger.log("Received ActivityMonitor state: \(state, privacy: .public)")
timerState = state
}
logger.log("Finished ActivityMonitor updates task: \(timerState, privacy: .public)")
}
}
}
Expand Down

0 comments on commit 41d3915

Please sign in to comment.