blog

package
v0.0.0-...-b1b21d8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: LGPL-3.0 Imports: 4 Imported by: 0

README

功能特色

  • 基于zap二次封装极大简化了日志记录
  • 为打印添加颜色,丰富打印效果

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Color

func Color(fgColor, bgColor int, texts ...any) string

黑色:0,红色:1,绿色:2,黄色:3,蓝色:4,紫红色:5,青蓝色:6,白色:7 fgColor:字体颜色,bgColor:背景颜色

Types

type Client

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

func NewClient

func NewClient(fileName string, fields ...map[string]any) *Client

创建日志客户端

func (*Client) Debug

func (obj *Client) Debug(val string, fields ...map[string]any)

func (*Client) Error

func (obj *Client) Error(val any, fields ...map[string]any)

func (*Client) Fatal

func (obj *Client) Fatal(val any, fields ...map[string]any)

func (*Client) Info

func (obj *Client) Info(val any, fields ...map[string]any)

func (*Client) Panic

func (obj *Client) Panic(val any, fields ...map[string]any)

func (*Client) Warn

func (obj *Client) Warn(val any, fields ...map[string]any)

type ClientOption

type ClientOption struct {
	Fields map[string]any //添加到json日志中的内容
}

Jump to

Keyboard shortcuts

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