logger

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorLogger

type ErrorLogger interface {
	LogError(file.Method) (string, error)
}

ErrorLogger is the same as a PostRequestLogger, but only logs if an error occurred.

If the generator does not have an [error] as its last return value, [LogError] will never be called.

It returns the code that is used for logging.

type Logger

type Logger interface {
	// Imports returns the import paths of the imports that are required
	// for the logger.
	Imports() []string
}

Logger is the abstraction of a logger. It should implement at least one of the below interfaces.

type PostRequestLogger

type PostRequestLogger interface {
	LogPostRequest(file.Method) (string, error)
}

PostRequestLogger is a Logger that logs after a request is made, regardless of whether an error occurred.

It returns the code that is used for logging.

type PreRequestLogger

type PreRequestLogger interface {
	LogPreRequest(file.Method) (string, error)
}

PreRequestLogger is a Logger that logs before a request is made.

It returns the code that is used for logging.

type SuccessLogger

type SuccessLogger interface {
	LogSuccess(file.Method) (string, error)
}

SuccessLogger is the same as a PostRequestLogger, but only logs if no error occurred.

If the generator does not have an [error] as its last return value, [LogSuccess] will always be called.

It returns the code that is used for logging.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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