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

Commit

Permalink
Add more debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Apr 24, 2024
1 parent 157ea8d commit d147ccc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Aware/Shared/UserDefaults+AsyncSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ extension UserDefaults {
) -> AsyncStream<Element?> {
.init(bufferingPolicy: .bufferingNewest(1)) { continuation in
let observer = Observer<Element>(store: self, keyPath: keyPath) { value in
logger.debug("Yielding UserDefaults new \"\(keyPath, privacy: .public)\" value")
logger.debug(
"Yielding UserDefaults \"\(keyPath, privacy: .public)\" value: \(String(describing: value))")
continuation.yield(value)
}

Expand Down
2 changes: 1 addition & 1 deletion Aware/macOS/ActivityMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct ActivityMonitor {
async let userDefaultsTask: () = { @MainActor in
let store = UserDefaults.standard
for await value in store.updates(forKeyPath: "reset", type: Bool.self, initial: true) {
logger.log("Received UserDefaults \"reset\" change")
logger.debug("Received UserDefaults \"reset\" change")
if value == true {
state.restart()
}
Expand Down
5 changes: 2 additions & 3 deletions Aware/visionOS/ActivityMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ struct ActivityMonitor {
async let userDefaultsTask: () = { @MainActor in
let store = UserDefaults.standard
for await value in store.updates(forKeyPath: "reset", type: Bool.self, initial: true) {
logger.log("Received UserDefaults \"reset\" change")
logger.debug("Received UserDefaults \"reset\" change")
if value == true {
state.deactivate()
state.activate()
state.restart()
}
if value != nil {
logger.debug("Cleaning up \"reset\" key")
Expand Down

0 comments on commit d147ccc

Please sign in to comment.