logpolicy: include Go version in version log

This commit is contained in:
Brad Fitzpatrick 2020-04-09 14:46:19 -07:00
parent 73249f8032
commit fe149979e6

View File

@ -21,6 +21,7 @@
"path/filepath" "path/filepath"
"runtime" "runtime"
"strconv" "strconv"
"strings"
"time" "time"
"github.com/klauspost/compress/zstd" "github.com/klauspost/compress/zstd"
@ -198,7 +199,10 @@ func New(collection string) *Policy {
log.SetFlags(0) // other logflags are set on console, not here log.SetFlags(0) // other logflags are set on console, not here
log.SetOutput(lw) log.SetOutput(lw)
log.Printf("Program starting: v%v: %#v\n", version.LONG, os.Args) log.Printf("Program starting: v%v, Go %v: %#v\n",
version.LONG,
strings.TrimPrefix(runtime.Version(), "go"),
os.Args)
log.Printf("LogID: %v\n", newc.PublicID) log.Printf("LogID: %v\n", newc.PublicID)
if filchErr != nil { if filchErr != nil {
log.Printf("filch failed: %v", err) log.Printf("filch failed: %v", err)