4

When a GUI program malfunctions in some way (crashes, etc.) I often use the trick of running it from the command line (instead of from the menu). That way I see the messages it outputs to stdout and stderr which sometimes gives me a clue as to what went wrong (or at least a message I can Google to take me further down the "solution path").

Is there any way I can get all GUI programs to save their stdout and stderr somewhere so I can diagnose problems without having to start them from the command line? Not only would this be more convenient, it would help users who don't know about this trick.

2 Answers 2

5

You mean, like the existing ~/.xsession-errors log?

Unfortunately it tends to get filled with lots of warnings & other useless messages.

2

For a particular menu command, you can change the command that start the application, for example with alacarte in gnome, to become something similar to:

command >~/log/command.out.log 2>~/log/command.err.log

where ~/log is a directory previously created, and command should be substituted with a real command name.

If that do not work, embed the command in a shell invocation:

sh -c 'command >~/log/command.out.log 2>~/log/command.err.log'

Unfortunately, I fear there is no general solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .