Skip to content

Instantly share code, notes, and snippets.

@jhoughjr
Created November 30, 2019 17:15
Show Gist options
  • Save jhoughjr/f95502c2396e887f515610b32e8459c3 to your computer and use it in GitHub Desktop.
Save jhoughjr/f95502c2396e887f515610b32e8459c3 to your computer and use it in GitHub Desktop.
More Apple Greatness
func show() {
SwiftyBeaver.info("show")
restoreCollapsedState()
restoreAttachedState()
orderFrontRegardless()
if let cont = contentViewController as? NSTabViewController {
SwiftyBeaver.info("\(cont.isViewLoaded)")
if let ctx = cont.tabViewItems[0].viewController as? ContextViewController {
SwiftyBeaver.info("context view \(ctx.view)")
}else {
SwiftyBeaver.info("\(cont.tabViewItems[0].viewController)")
}
}else {
SwiftyBeaver.info("was not tabvc \(contentViewController)")
}
SwiftyBeaver.info("done")
}
11:08:50.340 πŸ’š DEBUG AppDelegate.applicationDidFinishLaunching():40 - resetting logifle. Optional(file:///Users/jimmyhoughjr/Documents/Ghostnote%202/log.txt)
11:08:50.365 πŸ’š DEBUG AppDelegate.applicationDidFinishLaunching():45 - cleared log file at Optional(file:///Users/jimmyhoughjr/Documents/Ghostnote%202/log.txt)
11:08:50.365 πŸ’š DEBUG AppDelegate.applicationDidFinishLaunching():51 - Logging started.
11:08:50.374 πŸ’™ INFO Storage.mainContext():155 - using [<NSSQLCore: 0x600003e19800> (URL: file:///Users/jimmyhoughjr/Documents/Ghostnote%202/database/Ghostnote%202.sqlite)]
11:08:50.375 πŸ’™ INFO GhostEngineClient.engineFound():239 - /Applications/Ghostnote2.app/Contents/Resources/ghostengine.app
11:08:50.380 πŸ’™ INFO GhostEngineClient.engineFound():239 - /Applications/Ghostnote2.app/Contents/Resources/ghostengine.app
11:08:50.380 πŸ’™ INFO GhostEngineClient.launchGhostEngineIfNeeded():116 - found engine
11:08:50.380 πŸ’™ INFO GhostEngineClient.launchGhostEngineIfNeeded():121 - Found ghostengine process (32432) running.
11:08:50.381 πŸ’™ INFO GhostEngineClient.start():134 - Connecting to egnine @ ws://localhost:9000...
11:08:50.384 πŸ’™ INFO GhostEngineClient.webSocketClient():207 - Connected to ghostengine @ ws://localhost:9000
11:08:50.384 πŸ’™ INFO GhostEngineClient.connected():41 - connected = true
11:08:50.430 πŸ’š DEBUG GhostEngineClient.addObserver():150 - Added <Ghostnote2.ContextViewController: 0x10270d5e0>
11:08:50.435 πŸ’™ INFO ContextViewController.viewDidLoad():257 - LOADED CONTEXT VIEW (0.0, 0.0, 250.0, 300.0)
11:08:50.443 πŸ’™ INFO GNTabController.viewDidLoad():23 - [<NSTabViewItem 'Ghostnote2.ContextViewController': 0x600003004b40>, <NSTabViewItem 'Ghostnote2.ShortcutViewController': 0x600003004ab0>, <NSTabViewItem 'Support': 0x600003004bd0>]
11:08:50.453 πŸ’™ INFO GNTabController.awakeFromNib():18 - [<NSTabViewItem 'Ghostnote2.ContextViewController': 0x600003004b40>, <NSTabViewItem 'Ghostnote2.ShortcutViewController': 0x600003004ab0>, <NSTabViewItem 'Support': 0x600003004bd0>]
11:08:50.454 πŸ’™ INFO GhostNoteWindow.awakeFromNib():255 - expandedSize = (270.0, 348.0)
11:08:50.455 πŸ’™ INFO GNStatusItem.create():39 - creating attached to <NSWindowController: 0x60000260d140>
11:08:50.463 πŸ’™ INFO GhostEngineClient.engineFound():239 - /Applications/Ghostnote2.app/Contents/Resources/ghostengine.app
11:08:50.463 πŸ’™ INFO GNStatusItem.create():53 - GNStatusItem initialized.
11:08:50.463 πŸ’™ INFO GNStatusItem.create():54 - context Optional(<NSWindowController: 0x60000260d140>)
browser nil
statusItem Optional(<NSStatusItem: 0x600002135630>)
11:08:50.499 πŸ’™ INFO AppDelegate.setupActualApp():92 - Optional(true)
11:08:50.499 πŸ’™ INFO AppDelegate.setupActualApp():93 - Optional(<Ghostnote2.GNTabController: 0x600003308e60>)
11:08:53.148 πŸ’™ INFO GNStatusItem.toggleContextWindow():75 - toggle context window
11:08:53.148 πŸ’™ INFO GhostNoteWindow.show():169 - show
11:08:53.148 πŸ’™ INFO GhostNoteWindow.restoreCollapsedState():218 - frefreshing collapsed state
11:08:53.149 πŸ’™ INFO GhostNoteWindow.expandToHeight():362 - exapnding
11:08:53.149 πŸ’™ INFO GhostNoteWindow.expandToHeight():369 - new frame = (878.0, 530.0, 270.0, 348.0)
11:08:53.153 πŸ’™ INFO GhostNoteWindow.restoreAttachedState():230 - restoring attached state
11:08:53.153 πŸ’™ INFO GhostNoteWindow.attached():86 - attached
2019-11-30 11:08:53.158302-0600 Ghostnote2[40752:517290] Metal API Validation Enabled
11:08:53.224 πŸ’™ INFO ContextViewController.viewWillAppear():188 -
11:08:53.228 πŸ’™ INFO ContextViewController.viewDidAppear():203 -
11:08:53.228 πŸ’™ INFO GhostNoteWindow.show():176 - true
11:08:53.228 πŸ’™ INFO GhostNoteWindow.show():178 - context view <NSView: 0x10350f5b0>
11:08:53.228 πŸ’™ INFO GhostNoteWindow.show():185 - done
11:11:03.016 DEBUG AppDelegate.applicationDidFinishLaunching():51 - Logging started.
11:11:03.022 INFO Storage.mainContext():155 - using [<NSSQLCore: 0x6000022b1300> (URL: file:///Users/jimmyhoughjr/Documents/Ghostnote%202/database/Ghostnote%202.sqlite)]
11:11:03.023 INFO GhostEngineClient.engineFound():239 - /Applications/Ghostnote2.app/Contents/Resources/ghostengine.app
11:11:03.028 INFO GhostEngineClient.engineFound():239 - /Applications/Ghostnote2.app/Contents/Resources/ghostengine.app
11:11:03.028 INFO GhostEngineClient.launchGhostEngineIfNeeded():116 - found engine
11:11:03.028 INFO GhostEngineClient.launchGhostEngineIfNeeded():121 - Found ghostengine process (32432) running.
11:11:03.028 INFO GhostEngineClient.start():134 - Connecting to egnine @ ws://localhost:9000...
11:11:03.030 INFO GhostEngineClient.webSocketClient():207 - Connected to ghostengine @ ws://localhost:9000
11:11:03.030 INFO GhostEngineClient.connected():41 - connected = true
11:11:03.043 INFO GhostNoteWindow.awakeFromNib():255 - expandedSize = (270.0, 348.0)
11:11:03.045 INFO GNTabController.awakeFromNib():18 - [<NSTabViewItem 'Ghostnote2.ContextViewController': 0x600002ca42d0>, <NSTabViewItem 'Ghostnote2.ShortcutViewController': 0x600002ca43f0>, <NSTabViewItem 'Support': 0x600002ca4360>]
11:11:03.045 INFO GNStatusItem.create():39 - creating attached to <NSWindowController: 0x600003aa45a0>
11:11:03.052 INFO GhostEngineClient.engineFound():239 - /Applications/Ghostnote2.app/Contents/Resources/ghostengine.app
11:11:03.052 INFO GNStatusItem.create():53 - GNStatusItem initialized.
11:11:03.052 INFO GNStatusItem.create():54 - context Optional(<NSWindowController: 0x600003aa45a0>)
browser nil
statusItem Optional(<NSStatusItem: 0x600003daa4e0>)
11:11:03.058 INFO AppDelegate.setupActualApp():92 - Optional(true)
11:11:03.058 INFO AppDelegate.setupActualApp():93 - Optional(<Ghostnote2.GNTabController: 0x600002fa2940>)
11:11:05.168 INFO GNStatusItem.toggleContextWindow():75 - toggle context window
11:11:05.169 INFO GhostNoteWindow.show():169 - show
11:11:05.169 INFO GhostNoteWindow.restoreCollapsedState():218 - frefreshing collapsed state
11:11:05.169 INFO GhostNoteWindow.expandToHeight():362 - exapnding
11:11:05.169 INFO GhostNoteWindow.expandToHeight():369 - new frame = (868.0, 181.0, 0.0, 348.0)
11:11:05.169 INFO GhostNoteWindow.restoreAttachedState():230 - restoring attached state
11:11:05.169 INFO GhostNoteWindow.attached():86 - attached
11:11:05.173 INFO GhostNoteWindow.show():176 - true
@jhoughjr
Copy link
Author

As the logs show, for some very non obvious reason, anything past line 176 doesn't get executed in release build.
Interestingly, debug builds that are archived exhibit the same behavior.
I have no idea wtf is causing this.
HALP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment