log

package
v0.0.0-...-4a34f05 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ldate         = 1 << iota                                 // the date in the local time zone: 2009/01/23
	Ltime                                                     // the time in the local time zone: 01:23:23
	Lmicroseconds                                             // microsecond resolution: 01:23:23.123123.  assumes Ltime.
	Llongfile                                                 // full file name and line number: /a/b/c/d.go:23
	Lshortfile                                                // final file name element and line number: d.go:23. overrides Llongfile
	LUTC                                                      // if Ldate or Ltime is set, use UTC rather than the local time zone
	Lmsgprefix                                                // move the "prefix" from the beginning of the line to before the message
	LstdFlags     = log.LstdFlags | log.Lmsgprefix | log.LUTC // initial values for the standard logger
)

Variables

This section is empty.

Functions

func Warning

func Warning(format string, v ...any)

Types

type Level

type Level int
const (
	ERROR Level = iota + 1
	WARNING
	INFO
)

func ConvertLevelString

func ConvertLevelString(s string) Level

type Logger

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

func Default

func Default(level string, file ...string) *Logger

func New

func New(prefix string, flag int, removeTag bool, filePath string, maxLevel Level) *Logger

func (*Logger) Debug

func (lgr *Logger) Debug(level Level, format string, v ...any)

func (*Logger) Error

func (lgr *Logger) Error(format string, v ...any)

func (*Logger) Info

func (lgr *Logger) Info(format string, v ...any)

func (*Logger) Panic

func (lgr *Logger) Panic(format string, v ...any)

func (*Logger) SaveTo

func (lgr *Logger) SaveTo(file string)

func (*Logger) Warning

func (lgr *Logger) Warning(format string, v ...any)

func (*Logger) WithErrorLevel

func (lgr *Logger) WithErrorLevel() *log.Logger

func (*Logger) WithInfoLevel

func (lgr *Logger) WithInfoLevel() *log.Logger

func (*Logger) WithWarningLevel

func (lgr *Logger) WithWarningLevel() *log.Logger

Jump to

Keyboard shortcuts

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