From ed0492c15e8df989cf3f254afb6b9b04064d9356 Mon Sep 17 00:00:00 2001 From: Eason Lin Date: Thu, 24 Aug 2017 00:05:18 +0800 Subject: [PATCH] doc(readme): update writing logs section wording. --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 776ae8b8..faa6c9f0 100644 --- a/README.md +++ b/README.md @@ -413,16 +413,17 @@ func main() { } ``` -### Output log to file +### How to write log file ```go func main() { - // Disable Console Color, because not need color when output log to file + // Disable Console Color, you don't need console color when writing the logs to file. gin.DisableConsoleColor() - // Create one file to save logs + + //Logging to a file f, _ := os.Create("gin.log") - // Reset gin.DefaultWriter gin.DefaultWriter = io.MultiWriter(f) - // If need to output log to file and console at a time, please use the following code: + + // Use the following code if you need to write logs to file and console at the same time. // gin.DefaultWriter = io.MultiWriter(f, os.Stdout) router := gin.Default()