File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,22 @@ func main() {
3838
3939 if enableLogging {
4040 logfile := streams .OpenLogFileAs ("inols-err.log" )
41+ // log.SetOutput(io.MultiWriter(logfile, os.Stderr))
4142 defer func () {
42- // In case of panic output the stack trace in the log file before exiting
43- if r := recover (); r != nil {
44- log .Println (string (debug .Stack ()))
45- }
43+ // // In case of panic output the stack trace in the log file before exiting
44+ // if r := recover(); r != nil {
45+ // log.Println(string(debug.Stack()))
46+ // }
47+
4648 logfile .Close ()
4749 }()
48- log .SetOutput (io .MultiWriter (logfile , os .Stderr ))
50+ err := syscall .Dup2 (int (logfile .Fd ()), int (os .Stderr .Fd ()))
51+ if err != nil {
52+ log .Fatalf ("Failed to redirect stderr to file: %v" , err )
53+ }
4954 // log.SetOutput(logfile)
50- } else {
51- log .SetOutput (os .Stderr )
5255 }
56+ log .SetOutput (os .Stderr )
5357
5458 handler .Setup (cliPath , clangdPath , enableLogging , true )
5559 initialBoard := lsp.Board {Fqbn : initialFqbn , Name : initialBoardName }
You can’t perform that action at this time.
0 commit comments