#Windows WER but no crashoutput

16 messages · Page 1 of 1 (latest)

kind zodiac
#

Hi All,

I'm currently creating a DLL in windows, from some golang code.
I'm enabling WER with the debug.SetTraceback("wer") and it works correctly to produce a crashdump.

However, I want to suppress the trace output, because its just flooding the logs whenever it crashes.
Is there a way to use the debug.SetCrashOutput to stop the logging?

I've tried setting the below snippet, but its still printing out to the logs normally

debug.SetCrashOutput(nil, debug.CrashOptions{})```
young hornet
#

note, emphasis mine:

SetCrashOutput configures a single additional file where unhandled panics and other fatal errors are printed, in addition to standard error.

kind zodiac
#

ohhh thanks... facepalm

#

hmmm would i need to pipe stderr into io.Discard or something?

young hornet
#

you would typically do that from outside the program, not inside

#

e.g., if you're using a shell to launch the program, /path/to/executable 2> /dev/null

#

oh, windows

kind zodiac
#

yeah its a DLL, so i'm using C++ (msvc) to load in the DLL

#

with windows' LoadLibrary() function

young hornet
#

in cmd, 2> NUL

#

this is on a per-process basis, not a per-module

kind zodiac
#

ah ok thank you. I'll take a look in the C++ side then

kind zodiac
#
os.Stderr = os.DevNull```
#

would this change it? ThinkSpin_HD its not having any affect unfortunately

#

os.Stderr = os.NewFile(0, io.Discard)