console

package
v2.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a DNS middleware logger for consoles.

func New

func New(settings Settings) (logger *Logger, err error)

New creates a new console middleware logger.

func (*Logger) Error

func (l *Logger) Error(id uint16, errMessage string)

func (*Logger) Log

func (l *Logger) Log(remoteAddr net.Addr,
	request, response *dns.Msg)

type Settings

type Settings struct {
	// Writer is the writer to write logs to.
	// It defaults to os.Stdout.
	Writer io.Writer
	// LogRequests indicates requests should be logged.
	// If LogResponses is enabled as well, each request
	// is logged together with its matching response.
	LogRequests *bool
	// LogResponses indicates responses should be logged.
	// If LogRequests is enabled as well, each request
	// is logged together with its matching response.
	LogResponses *bool
}

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (*Settings) String

func (s *Settings) String() string

func (*Settings) ToLinesNode

func (s *Settings) ToLinesNode() (node *gotree.Node)

func (*Settings) Validate

func (s *Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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