log

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailureResponse

func FailureResponse(logger *Logger, req *http.Request, err error)

FailureResponse logs a rewrite failure.

func Query

func Query(logger *Logger, req *http.Request, rawQuery string)

Query logs a client-supplied query.

func Request

func Request(logger *Logger, req *http.Request)

Request logs a client request.

func SuccessResponse

func SuccessResponse(logger *Logger, req *http.Request)

SuccessResponse logs a successfully transformed response.

Types

type Level

type Level uint

Level is a log level.

const (
	// Debug is the lowest log level leading to most output.
	Debug Level = iota

	// Info is the log level for general-purpose messages.
	Info

	// Error is the highest log level reserved for error conditions.
	Error
)

func (Level) String

func (l Level) String() string

type Logger

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

Logger is a levelled logger.

func New

func New(level Level) *Logger

New returns a new logger with given level that writes to stdout.

func (*Logger) Debug

func (l *Logger) Debug(msg string)

Debug logs a debug message.

func (*Logger) Error

func (l *Logger) Error(msg string)

Error logs an error message.

func (*Logger) Info

func (l *Logger) Info(msg string)

Info logs an info message.

Jump to

Keyboard shortcuts

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