log

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	IsStdout bool
	Level    Level
}

func NewConsole

func NewConsole(stdout bool) *Console

func (*Console) Debug

func (c *Console) Debug(format string, p ...any)

func (*Console) Error

func (c *Console) Error(format string, p ...any)

func (*Console) Fatal

func (c *Console) Fatal(format string, p ...any)

func (*Console) Info

func (c *Console) Info(format string, p ...any)

func (*Console) Panic

func (c *Console) Panic(format string, p ...any)

func (*Console) SetLevel

func (c *Console) SetLevel(level Level)

func (*Console) Warn

func (c *Console) Warn(format string, p ...any)

type File

type File struct {
	Level Level
	// contains filtered or unexported fields
}

func NewFile

func NewFile(file *os.File) *File

func (*File) Debug

func (f *File) Debug(format string, p ...any)

func (*File) Error

func (f *File) Error(format string, p ...any)

func (*File) Fatal

func (f *File) Fatal(format string, p ...any)

func (*File) Info

func (f *File) Info(format string, p ...any)

func (*File) Panic

func (f *File) Panic(format string, p ...any)

func (*File) SetLevel

func (f *File) SetLevel(level Level)

func (*File) Warn

func (f *File) Warn(format string, p ...any)

type Level added in v1.0.3

type Level int
const (
	Debug Level = 0
	Info  Level = 1
	Warn  Level = 2
	Error Level = 3
	Fatal Level = 4
	Panic Level = 5
)

type Logger

type Logger interface {
	Debug(format string, p ...any)
	Info(format string, p ...any)
	Warn(format string, p ...any)
	Error(format string, p ...any)
	Fatal(format string, p ...any)
	Panic(format string, p ...any)
	SetLevel(level Level)
}

func NewConsoleLogger

func NewConsoleLogger(stdout bool) Logger

func NewFileLogger

func NewFileLogger(path string) Logger

Jump to

Keyboard shortcuts

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