Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultSensitiveFilter is a Filter that filters most sensitive data and // replaces it with `<elided>`. These fields are filtered: // token, access_token, refresh_token, key, password, code DefaultSensitiveFilter = FilterSensitive(defaultSensitive, defaultElided) // QueryFilter filters maps at the fields with the name 'query', using the same rules as // DefaultSensitiveFilter DefaultQueryFilter = RestrictFilter("query", LowerCaseFilter(MapFilter(SliceFilter(DefaultSensitiveFilter)))) )
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter interface {
Filter(string, interface{}) interface{}
}
A Filter is something that can filter a field value
func FilterSensitive ¶
FilterSensitive creates a Filter that filters most sensitive data like passwords, keys, access_tokens, etc. and replaces them with the elided value
func LowerCaseFilter ¶
LowerCaseFilter creates a filter that only get passed lowercase field names
func MapFilter ¶
MapFilter lifts the filter to also work on maps. It loses the type information of the map fields
func RestrictFilter ¶
RestrictFilter restricts the filter to only work on a certain field
func SliceFilter ¶
SliceFilter lifts the filter to also work on slices. It loses the type information of the slice elements
type FilterFunc ¶
type FilterFunc func(string, interface{}) interface{}
A FilterFunc is a function that implements the Filter interface
func (FilterFunc) Filter ¶
func (fn FilterFunc) Filter(k string, v interface{}) interface{}
Filter implements the Filter interface for FilterFuncs
type Filtered ¶
Filtered is a logger that filters the fields it receives
func Wrap ¶
Wrap wraps an existing logger, filtering the fields as it goes along using the provided filters
func (*Filtered) WithField ¶
WithField filters the field and passes it on to the wrapped loggers WithField
func (*Filtered) WithFields ¶
WithFields filters the fields and passes them on to the wrapped loggers WithFields
func (*Filtered) WithFilters ¶
WithFilter creates a new Filtered that will use the extra filters