You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to find a warning:
donny@donny-desktop:~/src/hg/gpsee$ gsr -c 'warning=42'
JS strict warning #156 in command_line at line 1 - assignment to undeclared
variable warning
How to lose a warning:
donny@donny-desktop:~/src/hg/gpsee$ gsr -c 'warning=42' &> log
donny@donny-desktop:~/src/hg/gpsee$ cat log
I was giving nickg some code to run to help evaluate a bug report, but then
I discovered the bug I'm reporting here now. The code below demonstrates my
proposed use case, and the reason I think the current behavior is a bug:
RESULTFILE=bugreport.txt
(hg id &&
make clean &&
make build &&
make install &&
echo @testing /tmp/foo ;
gsr -c 'require("/tmp/foo")' ;
echo @testing /tmp/foo.js ;
gsr -c 'require("/tmp/foo.js")'
) &> $RESULTFILE
Also -d doesn't help:
donny@donny-desktop:~/src/hg/gpsee$ gsr -c 'require("/foo/js")' &> f
donny@donny-desktop:~/src/hg/gpsee$ cat f
donny@donny-desktop:~/src/hg/gpsee$ gsr -dc 'require("/foo/js")' &> f
donny@donny-desktop:~/src/hg/gpsee$ cat f
donny@donny-desktop:~/src/hg/gpsee$ gsr -ddc 'require("/foo/js")' &> f
donny@donny-desktop:~/src/hg/gpsee$ cat f
donny@donny-desktop:~/src/hg/gpsee$ gsr -dddc 'require("/foo/js")' &> f
donny@donny-desktop:~/src/hg/gpsee$ cat f
I will take a look at this and try to ensure that -d will output the same
error and warning output even if the stderr is not a tty.
Wes please let me know if my intentions are pure and good.
Original issue reported on code.google.com by donny.vi...@gmail.com on 19 Apr 2010 at 2:01
The text was updated successfully, but these errors were encountered:
The basic problem is that:
1. -c and preload processing is independent of -d levels
2. Warnings and errors are reported on stderr
3. -c & preload sets a non-zero debug level only when stderr is not a TTY
(assumption
is that you are running from cron or something)
4. You are redirecting stderr
Generally speaking, we don't want errors and warnings going to non-TTY device
unless
explicitly requested with a raised debug level -- however, you are using -c
which is
debug-level agnostic.
So, we have two cases:
- people want -c to have a different-than-script debug level so that -c gives error
output when used alone
- people want -c to have the same-as-script debug level so that -d causes -c to put
output out stderr
Frankly, my immediate thought is to remove -c entirely, because we keep wasting
time
on it when it and it is confusing people. Confusing, conflicting features and
spaghetti code generally don't make for good software.
Original comment by wes%page...@gtempaccount.com on 19 Apr 2010 at 12:38
I've had some more thoughts about this code, hopefully I'm a little clearer now
that
that migraine is gone.
We need to decide if -c is going to get the same error handling as the main
program
or not. If so, we need to refactor gsr.c to get processFlags() happening
before the
-c code is executed. This may mean an extra getopt loop.
We also need to consider the case where users truly want debug output on their
non-tty outputs. What do you think about a -T flag which means "treat stderr
and
stdout as tty, whether they are or not?"
Original comment by wes%page...@gtempaccount.com on 23 Apr 2010 at 2:13
Original issue reported on code.google.com by
donny.vi...@gmail.com
on 19 Apr 2010 at 2:01The text was updated successfully, but these errors were encountered: