logger

package
v0.0.0-...-1db6f55 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

*

  • @Author: cloudintheking
  • @Description:
  • @File: logger
  • @Version: 1.0.0
  • @Date: 2021/10/22 15:41

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(config *Config) *zap.Logger

*

  • @Description: 初始化日志器
  • @param config 日志配置
  • @return *zap.Logger

Types

type Config

type Config struct {
	Env         string            `yaml:"env"`         //环境 develop、production
	Path        string            `yaml:"path"`        //存放路径
	MaxSize     int               `yaml:"maxSize"`     //最大存储容量,单位M
	MaxBackup   int               `yaml:"maxBackup"`   //最大备份数量
	MaxAge      int               `yaml:"maxAge"`      //保留天数
	Compress    bool              `yaml:"compress"`    //是否压缩
	Level       string            `yaml:"level"`       //日志等级
	Encoding    string            `yaml:"encoding"`    //输出格式 console、json
	ExtraFields map[string]string `yaml:"extraFields"` //额外字段
}

Jump to

Keyboard shortcuts

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