-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #471 from ElrondNetwork/fix-redirect-stderr-darwin
Fix redirect stderr darwin
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//+build linux darwin | ||
//+build linux | ||
|
||
package logger | ||
|
||
|