log

package
v0.0.0-...-4b2efa1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Fatal

func Fatal(err error, s string, v ...interface{})

func FatalOnError

func FatalOnError(err error, output ...interface{})

func GetLogFilePath

func GetLogFilePath() string

func Info

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

func Init

func Init(app string, opts ...Option) error

func InitLogger

func InitLogger(logLevel, appName string) error

func Verbose

func Verbose(s string, v ...interface{})

func Warn

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

Types

type AdaptorOption

type AdaptorOption func(*option)

type Config

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

type ExitFunc

type ExitFunc func()

type Level

type Level int
const (
	LOGERROR Level

	LOGINFO
	LOGVERBOSE
	LOGDEBUG
)

func (Level) String

func (l Level) String() string

type LogPrefixFunc

type LogPrefixFunc func(string) string

type Logger

type Logger interface {
	Verbose(string, ...interface{})
	Debug(string, ...interface{})
	Info(string, ...interface{})
	Warn(string, ...interface{})
	Error(string, ...interface{})
	Fatal(string, ...interface{})

	PutMetadata(string, string)
	Copy() Logger
}

func NewLogger

func NewLogger(opts ...Option) Logger

type Option

type Option func(*Config)

func WithAlsoToStd

func WithAlsoToStd() Option

func WithColor

func WithColor() Option

func WithFileLevel

func WithFileLevel(level Level) Option

func WithStdLevel

func WithStdLevel(level Level) Option

Jump to

Keyboard shortcuts

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