Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does stuff "print" to when not running application from terminal?

So I have a python application that is being bundled into a .app using py2app. I have some debugging print statements in there that would normally print to stdout if I was running the code in the terminal. If I just open the bundled .app, obviously I don't see any of this output. Is any of this actually being printed somewhere even though I don't see it?

like image 395
vik Avatar asked Feb 16 '23 23:02

vik


1 Answers

Where the stdout and stderr streams are redirect to depends on how you run the application, and on which OSX release you are.

When you run the application from the Terminal ("MyApp.app/Contents/MacOS/MyApp") the output ends up in the terminal window.

When you run the application by double clicking, or using the open(1) command, the output ends up in Console.app when using OSX before 10.8 and is discarded on OSX 10.8.

I have a patch that redirects output to the logs that Console.app reads even for OSX 10.8, but that is not in a released version at this point in time.

P.S. I'm the maintainer of py2app.

like image 109
Ronald Oussoren Avatar answered Feb 18 '23 15:02

Ronald Oussoren