config

package
v0.0.0-...-56f3d1a Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogConf

type LogConf struct {
	Module   string `yaml:"module,omitempty"`
	Filename string `yaml:"filename,omitempty"`
	// 日志格式:logfmt、json
	Fmt string `yaml:"fmt,omitempty"`
	// 日志输出级别:debug、trace、info、warn、error
	Level string `yaml:"level,omitempty"`
	// 日志分割周期(单位:分钟)
	RotateInterval int `yaml:"rotateInterval,omitempty"`
	// 日志保留天数(单位:小时)
	RotateBackups int `yaml:"rotateBackups,omitempty"`
	// 是否输出到标准输出
	Console bool `yaml:"console,omitempty"`
	// 设置日志模式是否是异步
	Async bool `yaml:"async,omitempty"`
	// 设置异步模式下缓冲区大小
	BufSize int `yaml:"bufSize,omitempty"`
}

LogConfig is the log config of node

func GetDefLogConf

func GetDefLogConf() *LogConf

func LoadLogConf

func LoadLogConf(cfgFile string) (*LogConf, error)

Jump to

Keyboard shortcuts

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