logging

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_ERROR_STACKS = 20

Functions

func BasicConfig

func BasicConfig(config LogConfig)

func Debug

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

func Error

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

func Exception

func Exception(err error)

func Fatal

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

func Info

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

func Panic

func Panic(err error)

func Warning

func Warning(format string, args ...interface{})

Types

type LogConfig

type LogConfig struct {
	Level          LogLevel
	MaxErrorStacks int
}

type LogLevel

type LogLevel uint32
const (
	ERROR   LogLevel = 1
	WARNING LogLevel = 2
	INFO    LogLevel = 3
	DEBUG   LogLevel = 4
)

type Logger

type Logger struct {
	Level          LogLevel
	MaxErrorStacks int
	Out            io.Writer
}

func New

func New() *Logger

func (*Logger) Debug

func (logger *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (logger *Logger) Error(format string, args ...interface{})

func (*Logger) Exception

func (logger *Logger) Exception(err error)

func (*Logger) Info

func (logger *Logger) Info(format string, args ...interface{})

func (*Logger) Panic

func (logger *Logger) Panic(err error)

func (*Logger) SetLevel

func (logger *Logger) SetLevel(logLevel LogLevel)

func (*Logger) SetMaxErrorStacks

func (logger *Logger) SetMaxErrorStacks(num int)

func (*Logger) Warning

func (logger *Logger) Warning(format string, args ...interface{})

Jump to

Keyboard shortcuts

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