Created
May 11, 2014 01:44
-
-
Save benlemasurier/8fdf64f3beda24d02411 to your computer and use it in GitHub Desktop.
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
f, err := os.OpenFile("testlogfile", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) | |
if err != nil { | |
log.Fatalf("error opening file: %v", err) | |
} | |
defer f.Close() | |
log.SetOutput(f) | |
log.Println(string(body)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment