/usr/share/gocode/src/gopkg.in/natefinch/lumberjack.v2/rotate_test.go is in golang-gopkg-natefinch-lumberjack.v2-dev 0.0~git20151013.600ceb4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | // +build linux
package lumberjack_test
import (
"log"
"os"
"os/signal"
"syscall"
"gopkg.in/natefinch/lumberjack.v2"
)
// Example of how to rotate in response to SIGHUP.
func ExampleLogger_Rotate() {
l := &lumberjack.Logger{}
log.SetOutput(l)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP)
go func() {
for {
<-c
l.Rotate()
}
}()
}
|