forked from natefinch/lumberjack
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'cilium/v2.0' into master_v2
* cilium/v2.0: cleanup and module support (natefinch#77) use 0755 to create new dir (natefinch#68) fix a typo (natefinch#62) Make default file permissions more restrictive (natefinch#83) Fix test timing (natefinch#64) Update docs, adding `Compress` setting details (natefinch#49) switch to travis (natefinch#44) Add support for log file compression (natefinch#43) Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
- Loading branch information
Showing
10 changed files
with
499 additions
and
129 deletions.
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,11 @@ | ||
language: go | ||
|
||
go: | ||
- tip | ||
- 1.15.x | ||
- 1.14.x | ||
- 1.13.x | ||
- 1.12.x | ||
|
||
env: | ||
- GO111MODULE=on |
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
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
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,18 +1,17 @@ | ||
package lumberjack_test | ||
package lumberjack | ||
|
||
import ( | ||
"log" | ||
|
||
"gopkg.in/natefinch/lumberjack.v2" | ||
) | ||
|
||
// To use lumberjack with the standard library's log package, just pass it into | ||
// the SetOutput function when your application starts. | ||
func Example() { | ||
log.SetOutput(&lumberjack.Logger{ | ||
log.SetOutput(&Logger{ | ||
Filename: "/var/log/myapp/foo.log", | ||
MaxSize: 500, // megabytes | ||
MaxBackups: 3, | ||
MaxAge: 28, // days | ||
MaxAge: 28, // days | ||
Compress: true, // disabled by default | ||
}) | ||
} |
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,8 @@ | ||
module github.com/natefinch/lumberjack | ||
|
||
require ( | ||
github.com/BurntSushi/toml v0.3.1 | ||
gopkg.in/yaml.v2 v2.2.2 | ||
) | ||
|
||
go 1.13 |
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,6 @@ | ||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= | ||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= | ||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
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
Oops, something went wrong.