OSX运行的应用程序的行为与在终端上运行的行为不同

I have written an app for OSX (Sierra) in Go (lang) with the GUI powered by the Golang QT binding therecipe/qt. When I build the app and run it from the command prompt with command open $(pwd)/myapp.app I get a terminal output while its running, and everything works fine.

When I double click on the app in finder to run it, I obviously don't have access to the console to see debugging, but in parts of the app that work fine in the GUI when I run from console (clicking on things, etc), it crashes the app when run by clicking on it.

I realise people don't know what the app is, and without seeing where in the app it crashes, they can't help me. What I am after is some ideas about debugging it, for instance:

  1. Outputting logs to a text file and tailing the text file to watch as it is written to
  2. Connecting a debugger to the application by the process, perhaps I can discover where it crashes. This doesn't sound straight forward
  3. Is there a way to attach to a console of an application run like this to see what it is outputting?

Any ideas appreciated. Thanks