blog

package
v0.0.0-...-0b0c4c8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Fatal

func Fatal(format string, a ...interface{})

func Info

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

func InitLoggerWithOpts

func InitLoggerWithOpts(opts *Config)

InitLoggerWithOpts init logger with options

func Warn

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

Types

type BankerLogger

type BankerLogger interface {
	// AddCallerSkip new cube logger with callstack skipping.
	AddCallerSkip(callerSkip int) BankerLogger

	// WithName adds some key-value pairs of context to a logger.
	// See Info for documentation on how key/value pairs work.
	WithName(name string) BankerLogger

	// WithValues adds a new element to the logger's name.
	// Successive calls with WithName continue to append
	// suffixes to the logger's name.  It's strongly recommended
	// that name segments contain only letters, digits, and hyphens
	// (see the package documentation for more information).
	WithValues(keysAndValues ...interface{}) BankerLogger

	Debug(format string, a ...interface{})

	Info(format string, a ...interface{})

	Warn(format string, a ...interface{})

	Error(format string, a ...interface{})

	Fatal(format string, a ...interface{})
}

func New

func New(opts *Config) BankerLogger

New create cube logger with options

func WithName

func WithName(name string) BankerLogger

func WithValues

func WithValues(keysAndValues ...interface{}) BankerLogger

type Config

type Config struct {
	LogFile    string
	MaxSize    int
	MaxBackups int
	MaxAge     int
	Compress   bool

	LogLevel        string
	JsonEncode      bool
	StacktraceLevel string
}

Jump to

Keyboard shortcuts

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