MCPcopy Create free account
hub / github.com/AdRoll/baker / fillDefaults

Method fillDefaults

output/filewriter.go:102–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100}
101
102func (cfg *FileWriterConfig) fillDefaults() {
103 if cfg.PathString == "" {
104 cfg.PathString = "/tmp/baker/ologs/logs/{{.Year}}/{{.Month}}/{{.Day}}/baker/{{.Year}}{{.Month}}{{.Day}}-{{.Hour}}{{.Minute}}{{.Second}}.{{.Index}}.log.gz"
105 }
106
107 switch cfg.RotateInterval {
108 case -1:
109 // no time-interval-based rotation
110 cfg.RotateInterval = 0
111 case 0:
112 // default value
113 cfg.RotateInterval = 60 * time.Second
114 }
115
116 if cfg.ZstdCompressionLevel == 0 {
117 cfg.ZstdCompressionLevel = 3
118 }
119}
120
121type FileWriter struct {
122 // atomically-accessed, keep on top for 64-bit alignment.

Callers 1

NewFileWriterFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected