log

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedactValue = "XXXXXXXX"
)

Variables

View Source
var RedactKeyList = []*regexp.Regexp{
	regexp.MustCompile(`(\\?"password\\?":\\?")([^"]*)(\\?")`),
	regexp.MustCompile(`(\\?"additional_trust_bundle\\?":\\?")([^"]*)(\\?")`),
	regexp.MustCompile(`(-----BEGIN CERTIFICATE-----)([^-----]*)(-----END CERTIFICATE-----)`),
	regexp.MustCompile(`(password\s*=\s*)([^\n\\\n]+)([\n\\\n]+)`),
	regexp.MustCompile(`(aws_(billing)?_?account_id[\s]*=[\s\\]*"?)([0-9]{12})([\\"]*)`),
	regexp.MustCompile(`(arn:aws:[^:]*:[a-z0-9-]*:)([0-9]{12})([^\n\"\\]*)`),
}

Functions

func NeedRedact added in v1.6.4

func NeedRedact(originalString string, regexP *regexp.Regexp) bool

func RedactString added in v1.6.4

func RedactString(fmtedString string) string

Types

type Log added in v1.6.0

type Log struct {
	// contains filtered or unexported fields
}
var Logger *Log = GetLogger()

func GetLogger

func GetLogger() *Log

func (*Log) Debug added in v1.6.0

func (l *Log) Debug(fmtString string)

func (*Log) Debugf added in v1.6.0

func (l *Log) Debugf(fmtString string, args ...interface{})

func (*Log) Error added in v1.6.0

func (l *Log) Error(fmtString string)

func (*Log) Errorf added in v1.6.0

func (l *Log) Errorf(fmtString string, args ...interface{})

func (*Log) Info added in v1.6.0

func (l *Log) Info(fmtString string)

func (*Log) Infof added in v1.6.0

func (l *Log) Infof(fmtString string, args ...interface{})

func (*Log) Redact added in v1.6.0

func (l *Log) Redact(fmtedString string) string

func (*Log) Warn added in v1.6.0

func (l *Log) Warn(fmtString string)

func (*Log) Warnf added in v1.6.0

func (l *Log) Warnf(fmtString string, args ...interface{})

Jump to

Keyboard shortcuts

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