logger

package
v0.0.398 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 3,019

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 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()
	Flush() error
	FlushTimeout(time.Duration) error
}

to update cd logger && go run github.com/maxbrunsfeld/counterfeiter -generate

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.
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