0

I created a simple desktop entry for all users /usr/share/applications/pycharm-foo.desktop

[Desktop Entry]
Name=PyCharm foo
Icon=/usr/share/pixmaps/python2.7.xpm
Exec=pycharm-wrapper foo
Terminal=false
Type=Application
Categories=Application

The application gets found via windows-key (launcher/dash).

But if the application fails with a message on stdout/stderr, then I would like to look at this message.

Where can I find error messages of failed application starts?

guettli
  • 1,765

4 Answers4

2

This question is probably a duplicate of:

There are two answers there:

  • Check the contents of ~/.xsession-errors log and,
  • Redirect output when calling command: command >~/log/command.out.log 2>~/log/command.err.log

Also if the process ID is known look at it's file descriptor 1 for stdout and 2 for stderr. This is described in detail in Unix & Linux:

To briefly summarize the top-voted answer:

lsof -p1234 | awk '$4 ~ /^[12][^0-9]/'
ls -l /proc/1234/fd/[12]

Of course the most common method is to simply call the GUI from the command line and your terminal window will show warning and error messages:

$ zenity --info --text "Hello World"
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
1

Well,

the only folder where logs are written is normally /var/log. In your case, the information your looking for could be at different places, because the developer can choose different ones, or might have decided to write logs to his/her own place.

It might be in /var/log/syslog - In syslog are all logs which derive from the system itself, but also programs which were programmed to write into syslog directly.

Then there should be something like /var/log/gdm3 - This is the logfile of the gnome window manager. So if gnome recognises smtg. or has problems itself, it would write it down there.

Did you consider to write it down to your own folder? You could simply append a logfile to your command and then the data would be written in there (according on how you set it up).

This is the second time I link to this today, lol. Look here, as you are using a python application (looks like it), this link should serve you well my friend. Give it a try.

Try to start your python wrapper like this pycharm-wrapper foo &>> /home/$(whoami)/mylogfile.log

Next time before you start, make sure to tail this. Open up a console and type in tail -f /home/($whoami)/mylogfile.log. THEN start you python wrapper and take a look at the console, if errors are displayed.

How do I save terminal output to a file?

s1mmel
  • 2,124
0

Nowhere that I can find documented and as already stated you'll get inconsistent results depending on the logging choices the developer of the program made. Perhaps they send errors to stderr, perhaps to stdout, perhaps it returns non-zero on error or perhaps it doesn't. Maybe you get pages of stack trace uselessness that won't fit in a dialog box.

I had a little success with a bash script wrapper that runs the command line you pass it and sends all output to a notification:

notify-send "$($* 2>&1)"

I'd expect inconsistent results though.

David S
  • 131
-1

Honestly what I would do is just use the following:

sudo su root

updatedb

cd /var/log

grep pycharm * > results.txt

cat results.txt

This should tell you which files where pycharm is mentioned in the logs then from that you could even filter further with something like:

cat results.txt | grep *error*

Maybe use fail or die instead of error to try to narrow down the results.

Taux1c
  • 76