zap_server

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 22

Documentation

Index

Constants

View Source
const ConfigFileName = "zap.yaml"

Variables

View Source
var CONFIG = Zap{
	Level:         "debug",
	Format:        "console",
	Prefix:        "[IRIS-ADMIN]",
	Director:      "logs",
	LinkName:      "latest_log",
	ShowLine:      true,
	EncodeLevel:   "LowercaseColorLevelEncoder",
	StacktraceKey: "stacktrace",
	LogInConsole:  false,
}
View Source
var (
	ZAPLOG *zap.Logger
)

level log level

Functions

func GetWriteSyncer

func GetWriteSyncer() (zapcore.WriteSyncer, error)

GetWriteSyncer

func IsExist added in v1.1.2

func IsExist() bool

IsExist config file is exist

func Recover added in v1.2.0

func Recover() error

Recover

func Remove added in v1.1.2

func Remove() error

Remove remove config file

func Strings

func Strings(key string, ss [][]string) zap.Field

Strings constructs a field that carries a slice of strings.

Types

type StringsArray

type StringsArray [][]string

func (StringsArray) MarshalLogArray

func (ss StringsArray) MarshalLogArray(arr zapcore.ArrayEncoder) error

MarshalLogArray

type Zap

type Zap struct {
	Level         string `mapstructure:"level" json:"level" yaml:"level"` //debug ,info,warn,error,panic,fatal
	Format        string `mapstructure:"format" json:"format" yaml:"format"`
	Prefix        string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
	Director      string `mapstructure:"director" json:"director"  yaml:"director"`
	LinkName      string `mapstructure:"link-name" json:"link-name" yaml:"link-name"`
	ShowLine      bool   `mapstructure:"show-line" json:"show-line" yaml:"show-line"`
	EncodeLevel   string `mapstructure:"encode-level" json:"encode-level" yaml:"encode-level"`
	StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktrace-key" yaml:"stacktrace-key"`
	LogInConsole  bool   `mapstructure:"log-in-console" json:"log-in-console" yaml:"log-in-console"`
}

Jump to

Keyboard shortcuts

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