diff --git a/core/logger/redirectStderrDarwin.go b/core/logger/redirectStderrDarwin.go new file mode 100644 index 00000000000..e7fba6f64a4 --- /dev/null +++ b/core/logger/redirectStderrDarwin.go @@ -0,0 +1,18 @@ +//+build darwin + +package logger + +import ( + "os" + "syscall" +) + +// redirectStderr redirects the output of the stderr to the file passed in +func redirectStderr(f *os.File) error { + err := syscall.Dup2(int(f.Fd()), int(os.Stderr.Fd())) + if err != nil { + return err + } + + return nil +} diff --git a/core/logger/redirectStderrLinux.go b/core/logger/redirectStderrLinux.go index 7aed514fd69..7316f8c3827 100644 --- a/core/logger/redirectStderrLinux.go +++ b/core/logger/redirectStderrLinux.go @@ -1,4 +1,4 @@ -//+build linux darwin +//+build linux package logger