File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ func getLogLevel() zapcore.Level {
3737func getEncoder () zapcore.Encoder {
3838 encoderConfig := zap .NewProductionEncoderConfig ()
3939 encoderConfig .EncodeTime = func (t time.Time , enc zapcore.PrimitiveArrayEncoder ) {
40- enc .AppendString (t .Local ().Format ("2006-01-02 15:04:05" ))
40+ location , err := time .LoadLocation ("Asia/Singapore" )
41+ if err != nil {
42+ location = time .Local
43+ }
44+ enc .AppendString (t .In (location ).Format ("2006-01-02 15:04:05" ))
4145 }
4246 encoderConfig .EncodeLevel = zapcore .CapitalLevelEncoder
4347 return zapcore .NewConsoleEncoder (encoderConfig )
Original file line number Diff line number Diff line change 2121)
2222
2323func main () {
24- defer func () {
25- if r := recover (); r != nil {
26- fmt .Printf ("panic: %v" , r )
27- }
28- fmt .Println ("=== app exit" )
29- }()
3024 fmt .Println ("Starting ceramicraft-user-mservice..." )
3125 config .Init ()
3226 log .InitLogger ()
You can’t perform that action at this time.
0 commit comments