log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	DebugLevel LogLevel = iota
	InfoLevel
	WarnLevel
	ErrorLevel
)

func StringToLogLevel

func StringToLogLevel(logLevel string) LogLevel

StringToLogLevel converts string to LogLevel, invalid strings will return InfoLevel

type Logger

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

Logger struct

func New

func New(service string) *Logger

New logger

func NewWithLogLevel

func NewWithLogLevel(service string, logLevel LogLevel) *Logger

NewWithLogLevel logger

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

Debug message

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

Debugf message

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

Error message

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...interface{})

Errorf message

func (*Logger) Fatal

func (l *Logger) Fatal(v ...interface{})

Fatal message

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, v ...interface{})

Fatalf message

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

Info message

func (*Logger) Infof

func (l *Logger) Infof(format string, v ...interface{})

Infof message

func (*Logger) Warning

func (l *Logger) Warning(v ...interface{})

Warn message

func (*Logger) Warningf

func (l *Logger) Warningf(format string, v ...interface{})

Warnf message

func (*Logger) WithLogLevel

func (l *Logger) WithLogLevel(logLevel LogLevel) *Logger

WithLogLevel fork a new logger

func (*Logger) WithService

func (l *Logger) WithService(service string) *Logger

WithService fork a new logger

Jump to

Keyboard shortcuts

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