1 2 3 4 5 6 7 8 9 10
package logging import ( "os" "syscall" ) func stderrToLogfile(logfile *os.File) { syscall.Dup3(int(logfile.Fd()), 2, 0) }