logger

package
v0.0.627 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 188 modules, 3,143 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

func AsString

func AsString(level LogLevel) string

Types

type LogLevel

type LogLevel int
const (
	LevelDebug LogLevel = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelNone LogLevel = 99
)

func Levelify

func Levelify(levelString string) (LogLevel, error)

type LogTag added in v0.0.425

type LogTag struct {
	Name     string   `json:"name"`
	LogLevel LogLevel `json:"log_level"`
}

type Logger

type Logger interface {
	Debug(tag, msg string, args ...interface{})
	DebugWithDetails(tag, msg string, args ...interface{})
	Info(tag, msg string, args ...interface{})
	Warn(tag, msg string, args ...interface{})
	Error(tag, msg string, args ...interface{})
	ErrorWithDetails(tag, msg string, args ...interface{})
	HandlePanic(tag string)
	ToggleForcedDebug()
	UseRFC3339Timestamps()
	UseTags(tags []LogTag)
	Flush() error
	FlushTimeout(time.Duration) error
}

func New

func New(level LogLevel, out *log.Logger) Logger

func NewAsyncWriterLogger

func NewAsyncWriterLogger(level LogLevel, ioWriter io.Writer) Logger

func NewLogger

func NewLogger(level LogLevel) Logger

func NewWriterLogger

func NewWriterLogger(level LogLevel, writer io.Writer) Logger

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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