Documentation ¶
Index ¶
- Variables
- func EncodeLevel(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func GRPCZapLogger(logger log.Logger) (*zap.Logger, error)
- func InitLogger(serviceName string, logLevel string, isGCPCompatible bool) log.Logger
- func RFC3339NanoTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func ServiceContext(name string) zap.Field
Constants ¶
This section is empty.
Variables ¶
View Source
var EncoderConfig = zapcore.EncoderConfig{ MessageKey: "message", LevelKey: "severity", TimeKey: "timestamp", NameKey: "logger", CallerKey: "caller", StacktraceKey: "stacktrace", LineEnding: zapcore.DefaultLineEnding, EncodeLevel: EncodeLevel, EncodeTime: RFC3339NanoTimeEncoder, EncodeDuration: zapcore.SecondsDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, }
encoderConfig is the default encoder configuration, slightly tweaked to use the correct fields for Stackdriver to parse them.
Functions ¶
func EncodeLevel ¶
func EncodeLevel(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
EncodeLevel maps the internal Zap log level to the appropriate Stackdriver level.
func GRPCZapLogger ¶
GRPCZapLogger returns *zap.Logger from salt/log.Logger. if error, returns a new *zap.Logger instance
func InitLogger ¶ added in v0.6.7
func RFC3339NanoTimeEncoder ¶
func RFC3339NanoTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
RFC3339NanoTimeEncoder serializes a time.Time to an RFC3339Nano-formatted string with nanoseconds precision.
func ServiceContext ¶
ServiceContext adds the correct service information adding the log line It is a required field if an error needs to be reported. See Service context and formatting error message
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.