logger

package
v1.0.0-alpha-rc Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogLevelInfo  LogLevel = "info"
	LogLevelDebug LogLevel = "debug"
	LogLevelError LogLevel = "error"

	LogFormatWithFile   = log.Ldate | log.Ltime | log.Lshortfile | log.Lmsgprefix
	LogFormatTime       = log.Ldate | log.Ltime | log.Lmsgprefix
	LogFormatPrefixOnly = log.Lmsgprefix
	LogFormatVerbose    = log.Ldate | log.Ltime | log.Llongfile | log.Lmsgprefix
)

Functions

func Debug

func Debug(v ...any)

func Debugf

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

func Error

func Error(v ...any)

func Errorf

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

func Fatal

func Fatal(v ...any)

func Fatalf

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

func Info

func Info(v ...any)

func Infof

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

func Panic

func Panic(v ...any)

func Panicf

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

func PrintJson

func PrintJson(data any, pretty bool)

func SetDebug

func SetDebug()

func SetError

func SetError()

func SetFormat

func SetFormat(format int)

func SetInfo

func SetInfo()

func SetLogLevel

func SetLogLevel(level LogLevel)

func SetOutputLevel

func SetOutputLevel(outputLevel int)

func StdOut

func StdOut(format int) *log.Logger

func Warning

func Warning(v ...any)

func Warningf

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

Types

type LogLevel

type LogLevel string

type Logger

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

func NewLogger

func NewLogger() *Logger

func NewLoggerWithFormat

func NewLoggerWithFormat(format int) *Logger

func (*Logger) Debug

func (l *Logger) Debug(v ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...any)

func (*Logger) Error

func (l *Logger) Error(v ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...any)

func (*Logger) Fatal

func (l *Logger) Fatal(v ...any)

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, v ...any)

func (*Logger) GetErrorLogger

func (l *Logger) GetErrorLogger() *log.Logger

func (*Logger) GetLevel

func (l *Logger) GetLevel() LogLevel

func (*Logger) GetPrintLogger

func (l *Logger) GetPrintLogger() *log.Logger

func (*Logger) Info

func (l *Logger) Info(v ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, v ...any)

func (*Logger) Json

func (l *Logger) Json(data any)

func (*Logger) JsonPretty

func (l *Logger) JsonPretty(data any)

func (*Logger) Panic

func (l *Logger) Panic(v ...any)

func (*Logger) Panicf

func (l *Logger) Panicf(format string, v ...any)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

func (*Logger) SetOutputLevel

func (l *Logger) SetOutputLevel(outputLevel int)

func (*Logger) Warning

func (l *Logger) Warning(v ...any)

func (*Logger) Warningf

func (l *Logger) Warningf(format string, v ...any)

Jump to

Keyboard shortcuts

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