clog

package
v1.3.1 Latest Latest
Warning

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

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

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 InitCubeLoggerWithOpts

func InitCubeLoggerWithOpts(opts *Config)

InitCubeLoggerWithOpts init cube logger with options

func Warn

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

Types

type Config

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

	// logger options
	LogLevel        string
	JsonEncode      bool
	StacktraceLevel string
}

type CubeLogger

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

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

	// 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{}) CubeLogger

	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) CubeLogger

New create cube logger with options

func WithName

func WithName(name string) CubeLogger

func WithValues

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

Jump to

Keyboard shortcuts

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