logging

package
v0.0.0-...-990f775 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogBundle

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

Struct that will returns in `New` function

func (*LogBundle) Error

func (l *LogBundle) Error(message string, r *http.Request, function any, params ...map[string]any)

Error message log

func (*LogBundle) Info

func (l *LogBundle) Info(message string, r *http.Request, function any, params ...map[string]any)

Info message log

func (*LogBundle) Panic

func (l *LogBundle) Panic(err any, r *http.Request, stack string, params ...map[string]any)

Panic message log

func (*LogBundle) Warning

func (l *LogBundle) Warning(message string, r *http.Request, function any, params ...map[string]any)

Warning message log

type Logger

type Logger interface {
	Info(message string, r *http.Request, function any, params ...map[string]any)
	Warning(message string, r *http.Request, function any, params ...map[string]any)
	Error(message string, r *http.Request, function any, params ...map[string]any)
	Panic(err any, r *http.Request, stack string, params ...map[string]any)
}

func New

func New(opt *Option, debug bool) (Logger, error)

Takes options needed for logs configs and returns a *Logger

If no address in `opt.Path` is provided, "/var/log/project" address will be used as default

type Option

type Option struct {
	Path, Pattern, MaxAge, RotationTime, RotationSize string
}

Jump to

Keyboard shortcuts

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