Commit 706adde 1 parent 9f5a604 commit 706adde Copy full SHA for 706adde
File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ func main() {
131
131
}
132
132
133
133
func init () {
134
- zap .ReplaceGlobals (zap .Must (zap .NewProduction ()))
135
134
if ! strings .HasPrefix (os .Getenv ("ENV" ), "prod" ) {
136
135
c := zap .NewDevelopmentEncoderConfig ()
137
136
c .EncodeLevel = zapcore .CapitalColorLevelEncoder
@@ -142,6 +141,12 @@ func init() {
142
141
zapcore .DebugLevel ,
143
142
))
144
143
zap .ReplaceGlobals (l )
144
+ } else {
145
+ zap .ReplaceGlobals (zap .New (zapcore .NewCore (
146
+ zapcore .NewJSONEncoder (zap .NewProductionEncoderConfig ()),
147
+ zapcore .AddSync (os .Stdout ),
148
+ zapcore .DebugLevel ,
149
+ )))
145
150
}
146
151
}
147
152
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ func main() {
42
42
43
43
cmd := exec .CommandContext (ctx , backrest )
44
44
cmd .SysProcAttr = & syscall.SysProcAttr {HideWindow : true }
45
- cmd .Env = append (os .Environ (), "ENV=prod" )
45
+ cmd .Env = os .Environ ()
46
+ cmd .Env = append (cmd .Env , "ENV=production" )
46
47
47
48
pro , pwo := io .Pipe ()
48
49
pre , pwe := io .Pipe ()
You can’t perform that action at this time.
0 commit comments