utils

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Black

func Black(str string) string

func Blue

func Blue(str string) string

func Cyan

func Cyan(str string) string

func GetLogLevel

func GetLogLevel(level string) []log.Level

GetLogLevel 获取日志等级

可能的值有

"trace","debug","info","warn","warn","error"

func GetPWScreen

func GetPWScreen(url string, device string) ([]byte, error)

func Green

func Green(str string) string

func Purple

func Purple(str string) string

func Red

func Red(str string) string

func SearchImage

func SearchImage(ketWord string) ([]string, error)

func White

func White(str string) string

func Yellow

func Yellow(str string) string

Types

type LogFormat

type LogFormat struct {
	TimeStampFormat string `json:"time_stamp_format"`

	LogContent string `json:"log_content"`
}

func (*LogFormat) Format

func (f *LogFormat) Format(entry *log.Entry) ([]byte, error)

type LogHook

type LogHook struct {
	LogChan chan string
	// contains filtered or unexported fields
}

func NewLogHook

func NewLogHook(formatter log.Formatter, levels []log.Level, writers ...io.Writer) *LogHook

func (*LogHook) AddWriter

func (l *LogHook) AddWriter(writer ...io.Writer)

func (*LogHook) Fire

func (l *LogHook) Fire(entry *log.Entry) error

func (*LogHook) Levels

func (l *LogHook) Levels() []log.Level

func (*LogHook) SetFormat

func (l *LogHook) SetFormat(format log.Formatter)

Jump to

Keyboard shortcuts

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