From aee4629129445bbdfb69aa565537dcfa16544311 Mon Sep 17 00:00:00 2001 From: Tyler Butters Date: Mon, 11 Sep 2017 10:04:57 -0400 Subject: [PATCH] Update docs, adding `Compress` setting details (#49) --- README.md | 5 +++++ example_test.go | 1 + lumberjack.go | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0042740..060eae5 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ log.SetOutput(&lumberjack.Logger{ MaxSize: 500, // megabytes MaxBackups: 3, MaxAge: 28, //days + Compress: true, // disabled by default }) ``` @@ -70,6 +71,10 @@ type Logger struct { // backup files is the computer's local time. The default is to use UTC // time. LocalTime bool `json:"localtime" yaml:"localtime"` + + // Compress determines if the rotated log files should be compressed + // using gzip. The default is not to perform compression. + Compress bool `json:"compress" yaml:"compress"` // contains filtered or unexported fields } ``` diff --git a/example_test.go b/example_test.go index bf689fd..df3dfb2 100644 --- a/example_test.go +++ b/example_test.go @@ -14,5 +14,6 @@ func Example() { MaxSize: 500, // megabytes MaxBackups: 3, MaxAge: 28, // days + Compress: true, // disabled by default }) } diff --git a/lumberjack.go b/lumberjack.go index ca19da4..46d97c5 100644 --- a/lumberjack.go +++ b/lumberjack.go @@ -104,7 +104,7 @@ type Logger struct { LocalTime bool `json:"localtime" yaml:"localtime"` // Compress determines if the rotated log files should be compressed - // using gzip. + // using gzip. The default is not to perform compression. Compress bool `json:"compress" yaml:"compress"` size int64