log

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CensorFormatter

type CensorFormatter struct {
	CensorItems         []CensorItem
	UnderlyingFormatter log.Formatter
}

CensorFormatter makes sure sensitive data is not logged. It works as a middleware and sensors the data before sending it to an underlying formatter

func (*CensorFormatter) Format

func (f *CensorFormatter) Format(entry *log.Entry) ([]byte, error)

Format censors some data and sends the entry to the underlying formatter

type CensorItem

type CensorItem struct {
	Sensitive   string
	Replacement string
}

CensorItem is something that should be censored, Sensitive will be replaced with Replacement

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL