RE: stderr output from gnome-shell



From: gnome-shell-list [mailto:gnome-shell-list-bounces gnome org] On
Behalf Of John Frankish
Sent: Wednesday, 03 June, 2015 09:57
To: gnome-shell-list gnome org
Subject: stderr output from gnome-shell

I've been trying to get stderr messages from gnome-shell-3.16.2.

if I change src/main.c line 400 to read:

int
main (int argc, char **argv)
{
  freopen("/tmp/mystderr.txt", "w", stderr);
  GOptionContext *ctx;
  ...

I expected to get JS LOG (I added "log('main.js start ');" to
js/ui/main.js)
and JS ERROR messages, but all I get is an empty file /tmp/mystderr.txt

As a test, I modified things to read:

freopen("/tmp/mystderr.txt", "w", stdout); printf("This text is redirected
to mystderr.txt\n");

..but again, all I get is an empty file.

Is there a trick to this? How do I get stderr output from gnome-shell

The trick has two parts:

1. to realise that the error was in mutter, not gnome-shell :(

And 

2. freopen("/tmp/mystderr.txt", "w", stderr);
printf("This text is redirected to mystderr.txt\n");
fflush(stderr);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]