Documentation ¶
Index ¶
- Variables
- func New(config *Config) (*zap.Logger, error)
- func RegisterTarget(target Target)
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetLevel() Level
- func (x *Config) GetLevels() []Level
- func (x *Config) GetMessages() map[string]*structpb.Value
- func (x *Config) GetStdout() bool
- func (x *Config) GetTargets() map[string]*structpb.Struct
- func (x *Config) GetTraceLevel() int32
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type Level
- type Target
- type TargetConfig
- func (*TargetConfig) Descriptor() ([]byte, []int)deprecated
- func (x *TargetConfig) GetLevel() Level
- func (x *TargetConfig) GetLevels() []Level
- func (x *TargetConfig) GetType() string
- func (*TargetConfig) ProtoMessage()
- func (x *TargetConfig) ProtoReflect() protoreflect.Message
- func (x *TargetConfig) Reset()
- func (x *TargetConfig) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Level_name = map[int32]string{ 0: "inherit", 1: "debug", 2: "info", 3: "warning", 4: "error", -1: "all", } Level_value = map[string]int32{ "inherit": 0, "debug": 1, "info": 2, "warning": 3, "error": 4, "all": -1, } )
Enum value maps for Level.
View Source
var File_component_log_log_proto protoreflect.FileDescriptor
Functions ¶
func RegisterTarget ¶
func RegisterTarget(target Target)
Types ¶
type Config ¶
type Config struct { // Targets 记录器 Targets map[string]*structpb.Struct `` /* 155-byte string literal not displayed */ // Stdout 输出到控制台 Stdout bool `protobuf:"varint,2,opt,name=stdout,proto3" json:"stdout,omitempty"` // TraceLevel 记录堆栈行号 TraceLevel int32 `protobuf:"varint,3,opt,name=trace_level,json=traceLevel,proto3" json:"trace_level,omitempty"` // level 最小日志等级 Level Level `protobuf:"varint,4,opt,name=level,proto3,enum=component.log.Level" json:"level,omitempty"` // levels 仅限设置的日志等级 Levels []Level `protobuf:"varint,5,rep,packed,name=levels,proto3,enum=component.log.Level" json:"levels,omitempty"` // Messages 记录固定的消息 Messages map[string]*structpb.Value `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetTraceLevel ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type Level ¶
type Level int32
func (Level) Descriptor ¶
func (Level) Descriptor() protoreflect.EnumDescriptor
func (Level) EnumDescriptor
deprecated
func (Level) Number ¶
func (x Level) Number() protoreflect.EnumNumber
func (Level) Type ¶
func (Level) Type() protoreflect.EnumType
type TargetConfig ¶
type TargetConfig struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // level 最小日志等级 Level Level `protobuf:"varint,2,opt,name=level,proto3,enum=component.log.Level" json:"level,omitempty"` // levels 仅限设置的日志等级 Levels []Level `protobuf:"varint,3,rep,packed,name=levels,proto3,enum=component.log.Level" json:"levels,omitempty"` // contains filtered or unexported fields }
func (*TargetConfig) Descriptor
deprecated
func (*TargetConfig) Descriptor() ([]byte, []int)
Deprecated: Use TargetConfig.ProtoReflect.Descriptor instead.
func (*TargetConfig) GetLevel ¶
func (x *TargetConfig) GetLevel() Level
func (*TargetConfig) GetLevels ¶
func (x *TargetConfig) GetLevels() []Level
func (*TargetConfig) GetType ¶
func (x *TargetConfig) GetType() string
func (*TargetConfig) ProtoMessage ¶
func (*TargetConfig) ProtoMessage()
func (*TargetConfig) ProtoReflect ¶
func (x *TargetConfig) ProtoReflect() protoreflect.Message
func (*TargetConfig) Reset ¶
func (x *TargetConfig) Reset()
func (*TargetConfig) String ¶
func (x *TargetConfig) String() string
Click to show internal directories.
Click to hide internal directories.