logging

package
v0.0.0-...-e064244 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 13 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, function interface{}, params map[string]interface{})

Error message log

Put your message in `message` variable and write your current function in `function` and if you need to print some more parameters, put them inside `params` variable

func (*LogBundle) Info

func (l *LogBundle) Info(message string, function interface{}, params map[string]interface{})

Info message log

Put your message in `message` variable and write your current function in `function` and if you need to print some more parameters, put them inside `params` variable

func (*LogBundle) Panic

func (l *LogBundle) Panic(message string, function interface{}, params map[string]interface{})

Panic message log

Put your message in `message` variable and write your current function in `function` and if you need to print some more parameters, put them inside `params` variable

func (*LogBundle) Warning

func (l *LogBundle) Warning(message string, function interface{}, params map[string]interface{})

Warning message log

Put your message in `message` variable and write your current function in `function` and if you need to print some more parameters, put them inside `params` variable

type Logger

type Logger interface {
	Info(message string, function interface{}, params map[string]interface{})
	Warning(message string, function interface{}, params map[string]interface{})
	Error(message string, function interface{}, params map[string]interface{})
	Panic(message string, function interface{}, params map[string]interface{})
}

func New

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

Takes options needed for logs configs and returns a *Logger

If no address in `opt.Path` is provided, for linux users: "/var/log/project" and for windows users "c:\\logs\project" address will be used as default path

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