Skip to content

Commit

Permalink
Added debug logging and defaults flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Hanson committed Oct 25, 2019
1 parent ed72b7c commit 11026f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Rectangle/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Defaults {
static let subsequentExecutionMode = SubsequentExecutionDefault()
static let allowAnyShortcut = BoolDefault(key: "allowAnyShortcut")
static let windowSnapping = OptionalBoolDefault(key: "windowSnapping")
static let debug = BoolDefault(key: "debug")
}

class BoolDefault {
Expand Down
5 changes: 5 additions & 0 deletions Rectangle/WindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Cocoa
import os.log

class WindowManager {

Expand Down Expand Up @@ -111,6 +112,10 @@ class WindowManager {
rect: resultingRect,
count: newCount
)

if Defaults.debug.enabled {
os_log("%{PUBLIC}@ | display: %{PUBLIC}@, calculatedRect: %{PUBLIC}@, resultRect: %{PUBLIC}@", type: .debug, action.name, visibleFrameOfDestinationScreen.debugDescription, newNormalizedRect.debugDescription, resultingRect.debugDescription)
}
}
}

Expand Down

0 comments on commit 11026f1

Please sign in to comment.