I envison to have --quiet and --debugoutput FILENAME as options in the future. For an end-user it is difficult to separate application output/error from VM one (e.g. the infamous thread priority warning). You can view, comment on, or merge this pull request online at:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/395
-- Commit Summary --
* debug: Prepare to let the app own stderr * debug: Introduce the --quiet VM option to keep things silent
-- File Changes --
M build.macos32x86/common/Makefile.vm (2) M build.macos64x64/common/Makefile.vm (2) M platforms/Cross/vm/sq.h (7) M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m (5) M platforms/unix/misc/threadValidate/sqUnixHeartbeat.c (6) M platforms/unix/misc/threadValidate/threadValidate.c (14) M platforms/unix/vm/aio.c (27) M platforms/unix/vm/debug.c (22) M platforms/unix/vm/debug.h (3) M platforms/unix/vm/dlfcn-dyld.c (20) M platforms/unix/vm/sqUnixCharConv.c (3) M platforms/unix/vm/sqUnixExternalPrims.c (46) M platforms/unix/vm/sqUnixHeartbeat.c (30) M platforms/unix/vm/sqUnixITimerTickerHeartbeat.c (6) M platforms/unix/vm/sqUnixMain.c (57) M platforms/unix/vm/sqUnixMemory.c (8) M platforms/unix/vm/sqUnixSpurMemory.c (4) M platforms/unix/vm/sqaio.h (2)
-- Patch Links --
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/395.patch https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/395.diff
bencoman commented on this pull request.
@@ -863,13 +863,13 @@ sqInt primitivePluginRequestState(void) { return dpy->primitivePluginRequestSta
static void outOfMemory(void) { - /* pushing stderr outputs the error report on stderr instead of stdout */ + /* pushing VM_ERR() outputs the error report on VM_ERR() instead of stdout */
What is the significance of changing this comment? (I'm not familiar with *pushOutputFile*)
pushOutputFile((char *)STDERR_FILENO);
error("out of memory\n"); }
/* Print an error message, possibly a stack trace, do /not/ exit. - * Allows e.g. writing to a log file and stderr. + * Allows e.g. writing to a log file and VM_ERR().
Same again. Search/replaced within comment useful?
An expansive scattering of changes, but pretty much all of them are... simply refactoring `fprintf(stderr,` ==> `fprintf(VM_ERR(),` excepting the following which looks fine... ``` static FILE *VM_ERR_FILE = NULL;
FILE *VM_ERR(void) { if (!VM_ERR_FILE) { VM_ERR_FILE = stderr; } return VM_ERR_FILE; }
void sqSetVmErrFile(FILE *file) { VM_ERR_FILE = file; }
static int vm_parseArgument(int argc, char **argv) { ... else if (!strcmp(argv[0], VMOPTION("quiet"))) { sqSetVmErrFile(fopen("/dev/null", "w")); return 1; } return 0; /* option not recognised */ }
(void) printUsage { ... printf(" "VMOPTION("quiet")" don't print debugging messages from the VM\n"); ... }
```
And the following seems correct to align with sq.h... ``` - extern void addIdleUsecs(long idleUsecs); + extern void addIdleUsecs(sqInt idleUsecs); ``` https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/83aebb122ca2fd32a86ef...
Hi Holger,
I don't object to this in principle. But I question whether it is necessary, except on Windows. Let me ask you why using the shell to redirect stderr to /dev/null is inadequate. I would simply do
bin/squeak my image.image 2>/dev/null &
Where does this not work?
It takes the ability from an application author to use stderr. I look at it from the point of view of using the "ecstatic" cli application (pillar to html) and the scheduler param warning printed by the VM really takes away from the quality/usefulness of the app (I have neither seen this with python, ruby, java, libstdc++ runtimes).
There are probably more elegant ways to achieve this but wanted to get a discussion started.
Closed #395.
Closing as contributing seemed too hard.
vm-dev@lists.squeakfoundation.org