logs

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 5 Imported by: ? modules, 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

View Source
const (
	LevelDebug = 1 + iota
	LevelInfo
	LevelWarn
	LevelError
)

Variables

This section is empty.

Functions

func Debug

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

func Debugf

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

func Error

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

func Errorf

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

func Flush

func Flush()

func Info

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

func Infof

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

func SetLevel

func SetLevel(level int)

func SetLogger

func SetLogger(logger Logger)

func Warn

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

func Warnf

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

Types

type Logger

type Logger interface {
	Debugf(format string, v ...interface{})
	Infof(format string, v ...interface{})
	Warnf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Flush()
	SetLevel(level int) error
}

TODO: merge with crafter logger package

type StdLogger

type StdLogger struct {
	Defer   bool
	ErrOnly bool
	// contains filtered or unexported fields
}

func NewStdLogger

func NewStdLogger(level int) *StdLogger

func (*StdLogger) Debugf

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

func (*StdLogger) Err

func (stdLogger *StdLogger) Err() string

func (*StdLogger) Errorf

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

func (*StdLogger) Flush

func (stdLogger *StdLogger) Flush()

func (*StdLogger) FlushErr

func (stdLogger *StdLogger) FlushErr()

func (*StdLogger) FlushOut

func (stdLogger *StdLogger) FlushOut()

func (*StdLogger) Infof

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

func (*StdLogger) Out

func (stdLogger *StdLogger) Out() []byte

func (*StdLogger) OutLines

func (stdLogger *StdLogger) OutLines() []string

func (*StdLogger) SetLevel

func (stdLogger *StdLogger) SetLevel(level int) error

func (*StdLogger) Warn

func (stdLogger *StdLogger) Warn() string

func (*StdLogger) Warnf

func (stdLogger *StdLogger) Warnf(format string, v ...interface{})

Jump to

Keyboard shortcuts

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