File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,22 @@ func main() {
38
38
39
39
if enableLogging {
40
40
logfile := streams .OpenLogFileAs ("inols-err.log" )
41
+ // log.SetOutput(io.MultiWriter(logfile, os.Stderr))
41
42
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
+
46
48
logfile .Close ()
47
49
}()
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
+ }
49
54
// log.SetOutput(logfile)
50
- } else {
51
- log .SetOutput (os .Stderr )
52
55
}
56
+ log .SetOutput (os .Stderr )
53
57
54
58
handler .Setup (cliPath , clangdPath , enableLogging , true )
55
59
initialBoard := lsp.Board {Fqbn : initialFqbn , Name : initialBoardName }
You can’t perform that action at this time.
0 commit comments