slog

package
v0.0.0-...-03464f5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 12 Imported by: 9

Documentation

Index

Constants

View Source
const TimeLayout = "2006-01-02T15:04:05-07:00"

TimeLayout is a fixed-length layout conforming to both ISO 8601 and RFC 3339

Variables

This section is empty.

Functions

func Binary

func Binary(level Level, bin []byte, v ...interface{})

func Binaryf

func Binaryf(level Level, bin []byte, format string, v ...interface{})

func Check

func Check(cond bool, v ...interface{})

func CheckLevel

func CheckLevel(level Level) bool

func Checkf

func Checkf(cond bool, format string, v ...interface{})

func Debug

func Debug(v ...interface{})

Extra information for debugging.

func Debugf

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

Extra information for debugging.

func Error

func Error(v ...interface{})

Issues that shouldn't be ignored.

func Errorf

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

Issues that shouldn't be ignored.

func Fatal

func Fatal(v ...interface{})

Serious problems that are likely to cause the program to exit.

func Fatalf

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

Serious problems that are likely to cause the program to exit.

func Info

func Info(v ...interface{})

Normal work reports.

func Infof

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

Normal work reports.

func Notice

func Notice(v ...interface{})

Important status changes. The prefix is 'I'.

func Noticef

func Noticef(format string, v ...interface{})

Important status changes. The prefix is 'I'.

func Output

func Output(calldepth int, level Level, extra func(io.Writer) error, v ...interface{}) error

func Outputf

func Outputf(calldepth int, level Level, extra func(io.Writer) error, format string, v ...interface{}) error

func Stack

func Stack(level Level, calldepth int, v ...interface{})

func Stackf

func Stackf(level Level, calldepth int, format string, v ...interface{})

func Text

func Text(level Level, txt string, v ...interface{})

func Textf

func Textf(level Level, txt string, format string, v ...interface{})

func Verbose

func Verbose(v ...interface{})

Details for inspecting specific issues.

func Verbosef

func Verbosef(format string, v ...interface{})

Details for inspecting specific issues.

func VeryVerbose

func VeryVerbose(v ...interface{})

More details that may significantly impact performance. The prefix is 'V'.

func VeryVerbosef

func VeryVerbosef(format string, v ...interface{})

More details that may significantly impact performance. The prefix is 'V'.

func Warning

func Warning(v ...interface{})

Issues that may be ignored.

func Warningf

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

Issues that may be ignored.

func Wrap

func Wrap(logger *Logger, level Level) *log.Logger

Types

type Level

type Level int32
const (
	LevelSilence Level = iota
	LevelFatal
	LevelError
	LevelWarning
	LevelNotice
	LevelInfo
	LevelDebug
	LevelVerbose
	LevelVeryVerbose
)

type Logger

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

func Default

func Default() *Logger

func NewLogger

func NewLogger() *Logger

func (*Logger) Debug

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

func (*Logger) Debugf

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

func (*Logger) Error

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

func (*Logger) Errorf

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

func (*Logger) Fatal

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

func (*Logger) Fatalf

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

func (*Logger) Info

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

func (*Logger) Infof

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

func (*Logger) Level

func (l *Logger) Level() Level

func (*Logger) Notice

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

func (*Logger) Noticef

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

func (*Logger) Output

func (l *Logger) Output(calldepth int, level Level, extra func(io.Writer) error, v ...interface{}) error

func (*Logger) Outputf

func (l *Logger) Outputf(calldepth int, level Level, extra func(io.Writer) error, format string, v ...interface{}) error

func (*Logger) SetFilePrefix

func (l *Logger) SetFilePrefix(prefix string)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetOutput

func (l *Logger) SetOutput(t OutputType, v ...interface{})

func (*Logger) Verbose

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

func (*Logger) Verbosef

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

func (*Logger) VeryVerbose

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

func (*Logger) VeryVerbosef

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

func (*Logger) Warning

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

func (*Logger) Warningf

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

type OutputType

type OutputType int
const (
	OutputDiscard OutputType = iota
	OutputWriter
	OutputSyslog
)

Jump to

Keyboard shortcuts

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