logger

package
v1.0.2-release Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMD

type CMD struct {
	LoggerEnabled    bool
	LogHeaderEnabled bool
	LogBodyEnabled   bool
	// contains filtered or unexported fields
}

CMD log to the stdout

func (CMD) AddSecret

func (l CMD) AddSecret(secret string) Logger

AddSecret add secret to be scrubbed from logging

func (CMD) ClearSecrets

func (l CMD) ClearSecrets() Logger

ClearSecrets clear secrets

func (CMD) Enabled

func (l CMD) Enabled() bool

Enabled to log to stdout

func (CMD) LogBody

func (l CMD) LogBody() bool

LogBody to log to stdout

func (CMD) LogHeader

func (l CMD) LogHeader() bool

LogHeader to log to stdout

func (CMD) Writef

func (l CMD) Writef(format string, a ...interface{})

Writef to stdout

func (CMD) Writeln

func (l CMD) Writeln(message string)

Writeln to stdout

type File

type File struct {
	Path string
}

File log to a file

type Logger

type Logger interface {
	Writef(string, ...interface{})
	Writeln(string)
	Enabled() bool
	LogHeader() bool
	LogBody() bool
	AddSecret(string) Logger
	ClearSecrets() Logger
}

Logger interface should be used to log to different locations

Jump to

Keyboard shortcuts

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