config

package
v0.9.5-rc Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_config_log_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type LogConfig

type LogConfig struct {

	// @gotags: toml:"file_name"
	FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty" toml:"file_name"` // 日志文件的名称, 默认值是 biz.log
	// @gotags: toml:"level"
	Level string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty" toml:"level"` // 日志等级, ["debug","info","warn","error"], 默认是 info
	// @gotags: toml:"json_format"
	JsonFormat *bool `protobuf:"varint,3,opt,name=json_format,json=jsonFormat,proto3,oneof" json:"json_format,omitempty" toml:"json_format"` // 是否开启json格式, 默认不开启
	// @gotags: toml:"max_size"
	MaxSize *uint32 `protobuf:"varint,4,opt,name=max_size,json=maxSize,proto3,oneof" json:"max_size,omitempty" toml:"max_size"` // 文件容量的最大值,单位是 mb, 默认是 1024
	// @gotags: toml:"max_backup"
	MaxBackup *uint32 `protobuf:"varint,5,opt,name=max_backup,json=maxBackup,proto3,oneof" json:"max_backup,omitempty" toml:"max_backup"` // 最大文件的保留数量, 默认保留200个
	// @gotags: toml:"max_age"
	MaxAge *uint32 `protobuf:"varint,6,opt,name=max_age,json=maxAge,proto3,oneof" json:"max_age,omitempty" toml:"max_age"` // 保存的最大天数, 默认保留7天
	// @gotags: toml:"compress"
	Compress *bool `protobuf:"varint,7,opt,name=compress,proto3,oneof" json:"compress,omitempty" toml:"compress"` // 是否压缩日志, 默认不压缩
	// @gotags: toml:"debug_mode_output_console"
	DebugModeOutputConsole *bool `` // debug 模式下输出到控制台, 默认不输出
	/* 171-byte string literal not displayed */
	// contains filtered or unexported fields
}

日志初始化配置, proto3 optional 特性

func (*LogConfig) Descriptor deprecated

func (*LogConfig) Descriptor() ([]byte, []int)

Deprecated: Use LogConfig.ProtoReflect.Descriptor instead.

func (*LogConfig) GetCompress

func (x *LogConfig) GetCompress() bool

func (*LogConfig) GetDebugModeOutputConsole

func (x *LogConfig) GetDebugModeOutputConsole() bool

func (*LogConfig) GetFileName

func (x *LogConfig) GetFileName() string

func (*LogConfig) GetJsonFormat

func (x *LogConfig) GetJsonFormat() bool

func (*LogConfig) GetLevel

func (x *LogConfig) GetLevel() string

func (*LogConfig) GetMaxAge

func (x *LogConfig) GetMaxAge() uint32

func (*LogConfig) GetMaxBackup

func (x *LogConfig) GetMaxBackup() uint32

func (*LogConfig) GetMaxSize

func (x *LogConfig) GetMaxSize() uint32

func (*LogConfig) ProtoMessage

func (*LogConfig) ProtoMessage()

func (*LogConfig) ProtoReflect

func (x *LogConfig) ProtoReflect() protoreflect.Message

func (*LogConfig) Reset

func (x *LogConfig) Reset()

func (*LogConfig) String

func (x *LogConfig) String() string

Jump to

Keyboard shortcuts

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