Documentation
¶
Index ¶
- Variables
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func DurationToMilliseconds(duration time.Duration) float32
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func LogAndReturnError(err error) error
- func Set(logger Logger)
- func SetLogValue(m map[string]interface{}, key string, val interface{})
- func Setup(config Config)
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- type Config
- type EncoderConfig
- type EpochMillisTimeEncoder
- type EpochNanosTimeEncoder
- type EpochTimeEncoder
- type ISO8601TimeEncoder
- type Logger
- type RFC3339NanoTimeEncoder
- type RFC3339TimeEncoder
- type StacktraceConfig
- type TimeEncoder
- type TimeEncoderWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var BodyKey = "body"
View Source
var CommandFilterKey = "commandFilter"
View Source
var CorrelationIDKey = "correlationId"
View Source
var DeadlineKey = "deadline"
View Source
var DeviceIDFilterKey = "deviceIdFilter"
View Source
var DeviceIDKey = "deviceId"
View Source
var DurationMSKey = "durationMs"
View Source
var ErrorKey = "error"
View Source
var EventFilterKey = "eventFilter"
View Source
var JWTKey = "jwt"
View Source
var JWTSubKey = "jwt.sub"
View Source
var MethodKey = "method"
View Source
var PlgdKey = "plgd"
View Source
var ProtocolKey = "protocol"
View Source
var RequestKey = "request"
View Source
var ResourceHrefKey = "href"
View Source
var ResourceIDFilterKey = "resourceIdFilter"
View Source
var ResponseKey = "response"
View Source
var StartTimeKey = "startTime"
View Source
var SubActionKey = "subscriptionAction"
View Source
var SubKey = "sub"
View Source
var TypeFilterKey = "typeFilter"
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func DurationToMilliseconds ¶ added in v2.2.4
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func Fatal ¶
func Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func LogAndReturnError ¶
func SetLogValue ¶ added in v2.2.4
Types ¶
type Config ¶
type Config struct { // Level is the minimum enabled logging level. Note that this is a dynamic // level, so calling Config.Level.SetLevel will atomically change the log // level of all loggers descended from this config. Level zapcore.Level `json:"level" yaml:"level"` // Encoding sets the logger's encoding. Valid values are "json" (default) and // "console", as well as any third-party encodings registered via // RegisterEncoder. Encoding string `json:"encoding" yaml:"encoding"` Stacktrace StacktraceConfig `json:"stacktrace" yaml:"stacktrace"` // An EncoderConfig allows users to configure the concrete encoders supplied by // zapcore. EncoderConfig EncoderConfig `json:"encoderConfig" yaml:"encoderConfig"` }
Config configuration for setup logging.
func MakeDefaultConfig ¶ added in v2.2.4
func MakeDefaultConfig() Config
type EncoderConfig ¶ added in v2.2.4
type EncoderConfig struct {
EncodeTime TimeEncoderWrapper `json:"timeEncoder" yaml:"timeEncoder"`
}
type EpochMillisTimeEncoder ¶ added in v2.2.4
type EpochMillisTimeEncoder struct { }
func (EpochMillisTimeEncoder) Encode ¶ added in v2.2.4
func (e EpochMillisTimeEncoder) Encode(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func (EpochMillisTimeEncoder) String ¶ added in v2.2.4
func (e EpochMillisTimeEncoder) String() string
func (EpochMillisTimeEncoder) TimeString ¶ added in v2.2.4
func (e EpochMillisTimeEncoder) TimeString() string
type EpochNanosTimeEncoder ¶ added in v2.2.4
type EpochNanosTimeEncoder struct { }
func (EpochNanosTimeEncoder) Encode ¶ added in v2.2.4
func (e EpochNanosTimeEncoder) Encode(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func (EpochNanosTimeEncoder) String ¶ added in v2.2.4
func (e EpochNanosTimeEncoder) String() string
func (EpochNanosTimeEncoder) TimeString ¶ added in v2.2.4
func (e EpochNanosTimeEncoder) TimeString() string
type EpochTimeEncoder ¶ added in v2.2.4
type EpochTimeEncoder struct { }
func (EpochTimeEncoder) Encode ¶ added in v2.2.4
func (e EpochTimeEncoder) Encode(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func (EpochTimeEncoder) String ¶ added in v2.2.4
func (e EpochTimeEncoder) String() string
func (EpochTimeEncoder) TimeString ¶ added in v2.2.4
func (e EpochTimeEncoder) TimeString() string
type ISO8601TimeEncoder ¶ added in v2.2.4
type ISO8601TimeEncoder struct { }
func (ISO8601TimeEncoder) Encode ¶ added in v2.2.4
func (e ISO8601TimeEncoder) Encode(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func (ISO8601TimeEncoder) String ¶ added in v2.2.4
func (e ISO8601TimeEncoder) String() string
func (ISO8601TimeEncoder) TimeString ¶ added in v2.2.4
func (e ISO8601TimeEncoder) TimeString() string
type Logger ¶
type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Debugf(template string, args ...interface{}) Infof(template string, args ...interface{}) Warnf(template string, args ...interface{}) Errorf(template string, args ...interface{}) Fatalf(template string, args ...interface{}) With(args ...interface{}) Logger Unwrap() interface{} LogAndReturnError(err error) error Config() Config Check(lvl zapcore.Level) bool }
type RFC3339NanoTimeEncoder ¶ added in v2.2.4
type RFC3339NanoTimeEncoder struct { }
func (RFC3339NanoTimeEncoder) Encode ¶ added in v2.2.4
func (e RFC3339NanoTimeEncoder) Encode(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func (RFC3339NanoTimeEncoder) String ¶ added in v2.2.4
func (e RFC3339NanoTimeEncoder) String() string
func (RFC3339NanoTimeEncoder) TimeString ¶ added in v2.2.4
func (e RFC3339NanoTimeEncoder) TimeString() string
type RFC3339TimeEncoder ¶ added in v2.2.4
type RFC3339TimeEncoder struct { }
func (RFC3339TimeEncoder) Encode ¶ added in v2.2.4
func (e RFC3339TimeEncoder) Encode(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func (RFC3339TimeEncoder) String ¶ added in v2.2.4
func (e RFC3339TimeEncoder) String() string
func (RFC3339TimeEncoder) TimeString ¶ added in v2.2.4
func (e RFC3339TimeEncoder) TimeString() string
type StacktraceConfig ¶ added in v2.2.4
type StacktraceConfig struct { Enabled bool `yaml:"enabled" json:"enabled" description:"enable stacktrace"` Level zapcore.Level `json:"level" yaml:"level" description:"from level"` }
func (*StacktraceConfig) Validate ¶ added in v2.2.4
func (c *StacktraceConfig) Validate() error
type TimeEncoder ¶ added in v2.2.4
type TimeEncoderWrapper ¶ added in v2.2.4
type TimeEncoderWrapper struct {
TimeEncoder TimeEncoder
}
func (TimeEncoderWrapper) MarshalText ¶ added in v2.2.4
func (t TimeEncoderWrapper) MarshalText() ([]byte, error)
func (*TimeEncoderWrapper) UnmarshalText ¶ added in v2.2.4
func (e *TimeEncoderWrapper) UnmarshalText(text []byte) error
Click to show internal directories.
Click to hide internal directories.