Documentation ¶
Index ¶
- func AbbreviatedArray(key string, elements interface{}, marshalFunc func(interface{}) []string) zap.Field
- func CL(c context.Context) *zap.Logger
- func ContextWithField(c context.Context, fields ...zap.Field) context.Context
- func File(file *backuppb.File) zap.Field
- func Files(fs []*backuppb.File) zap.Field
- func Key(fieldKey string, key []byte) zap.Field
- func Keys(keys [][]byte) zap.Field
- func Leader(peer *metapb.Peer) zap.Field
- func LoggerFromContext(c context.Context) *zap.Logger
- func Peer(peer *metapb.Peer) zap.Field
- func Redact(field zap.Field) zap.Field
- func RedactAny(fieldKey string, key interface{}) zap.Field
- func Region(region *metapb.Region) zap.Field
- func RegionBy(key string, region *metapb.Region) zap.Field
- func ResetGlobalLogger(l *zap.Logger)
- func RewriteRule(rewriteRule *import_sstpb.RewriteRule) zap.Field
- func SSTMeta(sstMeta *import_sstpb.SSTMeta) zap.Field
- func SSTMetas(sstMetas []*import_sstpb.SSTMeta) zap.Field
- func ShortError(err error) zap.Field
- func WarnTerm(message string, fields ...zap.Field)
- type AbbreviatedArrayMarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbbreviatedArray ¶
func AbbreviatedArray( key string, elements interface{}, marshalFunc func(interface{}) []string, ) zap.Field
AbbreviatedArray constructs a field that abbreviates an array of elements.
func ContextWithField ¶
ContextWithField wrap a context with a logger with some fields.
func LoggerFromContext ¶
LoggerFromContext returns the contextual logger via the context. If there isn't a logger in the context, returns the global logger.
func ResetGlobalLogger ¶
ResetGlobalLogger resets the global logger. Contexts have already made by `ContextWithField` would keep untouched, subsequent wrapping over those contexts would keep using the old global logger, only brand new contexts (i.e. context without logger) would be wrapped with the new global logger. This method is mainly for testing.
func RewriteRule ¶
func RewriteRule(rewriteRule *import_sstpb.RewriteRule) zap.Field
RewriteRule make the zap fields for a rewrite rule.
func SSTMeta ¶
func SSTMeta(sstMeta *import_sstpb.SSTMeta) zap.Field
SSTMeta make the zap fields for a SST meta.
func SSTMetas ¶
func SSTMetas(sstMetas []*import_sstpb.SSTMeta) zap.Field
SSTMetas make the zap fields for SST metas.
func ShortError ¶
ShortError make the zap field to display error without verbose representation (e.g. the stack trace).
Types ¶
type AbbreviatedArrayMarshaler ¶
type AbbreviatedArrayMarshaler []string
AbbreviatedArrayMarshaler abbreviates an array of elements.
func (AbbreviatedArrayMarshaler) MarshalLogArray ¶
func (abb AbbreviatedArrayMarshaler) MarshalLogArray(encoder zapcore.ArrayEncoder) error
MarshalLogArray implements zapcore.ArrayMarshaler.