Log

package
v0.0.0-...-74cfed9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextBlack = iota + 30
	TextRed
	TextGreen
	TextYellow
	TextBlue
	TextMagenta
	TextCyan
	TextWhite
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log byte

func (*Log) Black

func (*Log) Black(msg string) string

func (*Log) Blue

func (*Log) Blue(msg string) string

func (*Log) Cyan

func (*Log) Cyan(msg string) string

func (*Log) Green

func (*Log) Green(msg string) string

func (*Log) Init

func (toolLog *Log) Init(conf LogConfig) *zap.Logger

Init 初始化,生成的日志文件夹名字

func (*Log) Instance

func (*Log) Instance() *zap.Logger

Instance 唯一实例

func (*Log) Magenta

func (*Log) Magenta(msg string) string

func (*Log) NewLogger

func (*Log) NewLogger(opts ...Option) *zap.Logger

NewLogger 新建日志

func (*Log) Red

func (*Log) Red(msg string) string

func (*Log) SetColor

func (*Log) SetColor(msg string, conf, bg, text int) string

func (*Log) White

func (*Log) White(msg string) string

func (*Log) Yellow

func (*Log) Yellow(msg string) string

type LogConfig

type LogConfig struct {
	Path    string `yaml:"path"`
	Name    string `yaml:"name"`
	Level   string `yaml:"level"`
	MaxSize int    `yaml:"max_size"`
	MaxAge  int    `yaml:"max_age"`

	Stacktrace string `yaml:"stacktrace"`
	Stdout     bool   `yaml:"stdout"`
}

type Option

type Option func(*LogConfig)

Jump to

Keyboard shortcuts

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