util

package
v0.0.0-...-e121adf Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTimeFormat = "2006-01-02 15:04:05.000000"
	LogFuncName   = false
)

Variables

This section is empty.

Functions

func IsIP

func IsIP(str string) bool

func IsPort

func IsPort(str string) bool

func LogD

func LogD(tag string, format string, a ...interface{})

func LogE

func LogE(tag string, format string, a ...interface{})

func LogF

func LogF(tag string, format string, a ...interface{})

func LogI

func LogI(tag string, format string, a ...interface{})

func LogP

func LogP(tag string, format string, a ...interface{})

func PrintMemUsage

func PrintMemUsage(w io.Writer)

func SetLogLevel

func SetLogLevel(level LogLevel)

func SetLogLevelString

func SetLogLevelString(level string)

Types

type LogLevel

type LogLevel uint8
const (
	PanicLevel LogLevel = iota
	FatalLevel
	ErrorLevel
	WarningLevel
	InfoLevel
	DebugLevel
)

type Logger

type Logger struct {
	Out    io.Writer
	Level  LogLevel
	Prefix string
}

func NewLogger

func NewLogger(level LogLevel, out io.Writer, prefix string) *Logger

type MPatternMix

type MPatternMix struct {
	ReList MRegexpPairList
}

func NewMPatternMix

func NewMPatternMix(patterns map[string]string) *MPatternMix

func (*MPatternMix) IsMatch

func (p *MPatternMix) IsMatch(key string, value string) bool

type MRegexp

type MRegexp struct {
	*regexp.Regexp
}

func (*MRegexp) FindStringSubmatchMap

func (r *MRegexp) FindStringSubmatchMap(s string, group_prefix string) MRegexpMatch

type MRegexpMap

type MRegexpMap map[string]*MRegexp

func NewMRegexpMap

func NewMRegexpMap(patterns map[string]string) MRegexpMap

type MRegexpMatch

type MRegexpMatch map[string]string

type MRegexpPair

type MRegexpPair struct {
	First, Second *MRegexp
}

type MRegexpPairList

type MRegexpPairList []*MRegexpPair

Jump to

Keyboard shortcuts

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