Skip to content

Commit

Permalink
Cleanup: drop redundant debug function
Browse files Browse the repository at this point in the history
It polutes stdout for nothing. It's not a proper logging anyway
  • Loading branch information
nikitabobko committed Aug 3, 2024
1 parent c272d67 commit c4f62a5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion Sources/AppBundle/server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ private func newConnection(_ socket: Socket) async { // todo add exit codes
_ = try? socket.write(from: Result { try JSONEncoder().encode(ans) }.getOrThrow())
}
defer {
debug("Close connection")
socket.close()
}
while true {
Expand Down
1 change: 0 additions & 1 deletion Sources/AppBundle/tree/MacApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ final class MacApp: AbstractApp {
}

private func garbageCollect() {
debug("garbageCollectApp: terminated \(self.name ?? "")")
MacApp.allAppsMap.removeValue(forKey: nsApp.processIdentifier)
for obs in axObservers {
AXObserverRemoveNotification(obs.obs, obs.ax, obs.notif)
Expand Down
3 changes: 0 additions & 3 deletions Sources/AppBundle/tree/MacWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ final class MacWindow: Window, CustomStringConvertible {
window.observe(refreshObs, kAXWindowMiniaturizedNotification) &&
window.observe(movedObs, kAXMovedNotification) &&
window.observe(resizedObs, kAXResizedNotification) {
debug("New window detected: \(window)")
allWindowsMap[id] = window
debugWindowsIfRecording(window)
tryOnWindowDetected(window, startup: startup)
Expand All @@ -60,7 +59,6 @@ final class MacWindow: Window, CustomStringConvertible {
}

func garbageCollect() {
debug("garbageCollectWindow of \(app.name ?? "NO TITLE")")
if MacWindow.allWindowsMap.removeValue(forKey: windowId) == nil {
return
}
Expand Down Expand Up @@ -113,7 +111,6 @@ final class MacWindow: Window, CustomStringConvertible {
// Don't accidentally override prevUnhiddenEmulationPosition in case of subsequent
// `hideEmulation` calls
if !isHiddenViaEmulation {
debug("hideViaEmulation: Hide \(self)")
guard let topLeftCorner = getTopLeftCorner() else { return }
guard let workspace else { return } // hiding only makes sense for workspace windows
prevUnhiddenEmulationPositionRelativeToWorkspaceAssignedRect =
Expand Down
6 changes: 0 additions & 6 deletions Sources/AppBundle/util/util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ extension Set {
func toArray() -> [Element] { Array(self) }
}

func debug(_ msg: Any) {
if isDebug {
print(msg)
}
}

#if DEBUG
let isDebug = true
#else
Expand Down

0 comments on commit c4f62a5

Please sign in to comment.