golog

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: GPL-3.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int8
const (
	// TraceLevel defines trace log level.
	TraceLevel Level = iota
	// DebugLevel defines debug log level.
	DebugLevel
	// InfoLevel defines info log level.
	InfoLevel
	// WarnLevel defines warn log level.
	WarnLevel
	// ErrorLevel defines error log level.
	ErrorLevel
	// FatalLevel defines fatal log level.
	FatalLevel
)

type MyLogger

type MyLogger interface {
	Trace(msg string, v ...interface{})
	Debug(msg string, v ...interface{})
	Info(msg string, v ...interface{})
	Warn(msg string, v ...interface{})
	Error(msg string, v ...interface{})
	Fatal(msg string, v ...interface{})
	GetDefaultLogger() (*log.Logger, error)
	TraceHttpRequest(handlerName string, r *http.Request)
}

func NewLogger

func NewLogger(loggerType string, logLevel Level, prefix string) (MyLogger, error)

func NewSimpleLogger

func NewSimpleLogger(logLevel Level, prefix string) (MyLogger, error)

type SimpleLogger

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

func (*SimpleLogger) Debug

func (l *SimpleLogger) Debug(msg string, v ...any)

func (*SimpleLogger) Error

func (l *SimpleLogger) Error(msg string, v ...interface{})

func (*SimpleLogger) Fatal

func (l *SimpleLogger) Fatal(msg string, v ...interface{})

func (*SimpleLogger) GetDefaultLogger added in v0.0.9

func (l *SimpleLogger) GetDefaultLogger() (*log.Logger, error)

func (*SimpleLogger) Info

func (l *SimpleLogger) Info(msg string, v ...interface{})

func (*SimpleLogger) Trace added in v0.3.8

func (l *SimpleLogger) Trace(msg string, v ...any)

func (*SimpleLogger) TraceHttpRequest added in v0.3.8

func (l *SimpleLogger) TraceHttpRequest(handlerName string, r *http.Request)

func (*SimpleLogger) Warn

func (l *SimpleLogger) Warn(msg string, v ...interface{})

Jump to

Keyboard shortcuts

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