utils

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const BufSize = 1 << 12

Variables

This section is empty.

Functions

func FreeBytes

func FreeBytes(b []byte)

func NewBytes

func NewBytes(size int) []byte

func SetBufferPool

func SetBufferPool(p *sync.Pool)

Types

type LogLevel

type LogLevel uint8
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
)

type LogOutputFunc

type LogOutputFunc func(string2 string, args ...any)

type Logger

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

func LogInst

func LogInst() *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, args ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(msg string, args ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(msg string, args ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(msg string, args ...interface{})

func (*Logger) InitParam

func (l *Logger) InitParam(level LogLevel, of LogOutputFunc)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

func (*Logger) SetOutput

func (l *Logger) SetOutput(oFunc LogOutputFunc)

func (*Logger) Warnf

func (l *Logger) Warnf(msg string, args ...interface{})

Jump to

Keyboard shortcuts

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