internal/log/log.go (15 lines of code) (raw):
// Licensed to Elasticsearch B.V. under one or more agreements.
// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
package log
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func NewLogger() (*zap.Logger, error) {
conf := zap.NewProductionConfig()
conf.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
conf.Level = zap.NewAtomicLevelAt(zap.DebugLevel)
log, err := conf.Build()
if err != nil {
return nil, err
}
return log, nil
}