Documentation
¶
Index ¶
- Constants
- Variables
- func Level(level logrus.Level)
- func WithContext(ctx context.Context, params map[string]any, opts ...[]Option) *logrus.Entry
- type CallerSkip
- type EmptyWriter
- type ExcludePaths
- type FileHook
- type FileHook_Rotation
- type FormatterInterface
- type IncludePaths
- type LogComponent
- type LogConf
- type LogConf_Clients
- type LogDriver
- type LogFormat
- type LokiHook
- type LokiReq
- type LokiReq_Stream
- type Option
- type RotationType
- type StdoutHook
Constants ¶
View Source
const ( LogConfigName = "LogConf" LOG_DRIVER_STDOUT LogDriver = "stdout" LOG_DRIVER_FILE LogDriver = "file" LOG_DRIVER_LOKI LogDriver = "loki" LOG_FORMAT_JSON LogFormat = "json" LOG_FORMAT_TEXT LogFormat = "text" ROTATION_TYPE_MINUTE RotationType = "minute" ROTATION_TYPE_HOUR RotationType = "hour" ROTATION_TYPE_DAY RotationType = "day" ROTATION_TYPE_MONTH RotationType = "month" ROTATION_TYPE_YEAR RotationType = "year" LOG_FIELD_LEVEL string = "level" LOG_FIELD_PARAMS string = "params" LOG_FIELD_MESSAGE string = "message" LOG_FIELD_DATETIME string = "datetime" LOG_FIELD_REPORTER string = "reporter" )
View Source
const ( PanicLevel logrus.Level = iota FatalLevel ErrorLevel WarnLevel InfoLevel DebugLevel TraceLevel )
Variables ¶
View Source
var Component = &LogComponent{}
Functions ¶
Types ¶
type CallerSkip ¶ added in v0.4.14
type CallerSkip int
func (CallerSkip) Value ¶ added in v0.4.20
func (i CallerSkip) Value() any
type EmptyWriter ¶ added in v0.4.0
type EmptyWriter struct{}
func NewEmptyWriter ¶ added in v0.4.0
func NewEmptyWriter() *EmptyWriter
type ExcludePaths ¶ added in v0.4.19
type ExcludePaths []string
func (ExcludePaths) Value ¶ added in v0.4.20
func (i ExcludePaths) Value() any
type FileHook ¶ added in v0.4.0
type FileHook struct {
Path string `json:"path"`
Format LogFormat `json:"format"`
Rotation FileHook_Rotation `json:"rotation"`
}
func (FileHook) GetColorful ¶ added in v0.4.3
type FileHook_Rotation ¶ added in v0.4.3
type FileHook_Rotation struct {
Enable bool `json:"enable"`
Type RotationType `json:"type"`
MaxFile int64 `json:"max_file"`
MaxSize int64 `json:"max_size"`
}
type FormatterInterface ¶ added in v0.4.3
type IncludePaths ¶ added in v0.4.19
type IncludePaths []string
func (IncludePaths) Value ¶ added in v0.4.20
func (i IncludePaths) Value() any
type LogComponent ¶ added in v0.4.0
type LogComponent struct{}
func (*LogComponent) Inject ¶ added in v0.4.0
func (i *LogComponent) Inject(instance any) bool
func (*LogComponent) InjectConf ¶ added in v0.4.0
func (i *LogComponent) InjectConf(config cComponents.ConfigInterface) bool
func (*LogComponent) Listen ¶ added in v0.4.0
func (i *LogComponent) Listen() []*cComponents.ConfigListener
func (*LogComponent) Load ¶ added in v0.4.0
func (i *LogComponent) Load()
type LogConf ¶
type LogConf struct {
Level logrus.Level `json:"level"`
Drivers []LogDriver `json:"drivers"`
WithFields map[string]any `json:"with_fields"`
Excludes []string `json:"excludes"`
Clients LogConf_Clients `json:"clients"`
}
func (*LogConf) ConfigName ¶
type LogConf_Clients ¶ added in v0.0.52
type LogConf_Clients struct {
File FileHook `json:"file"`
Loki LokiHook `json:"loki"`
Stdout StdoutHook `json:"stdout"`
}
type LokiHook ¶ added in v0.0.52
type LokiHook struct {
Host string `json:"host"`
Uri string `json:"uri"`
QueueMaxSize int `json:"queue_max_size"`
QueueSpeed int `json:"queue_speed"`
Timeout int64 `json:"timeout"`
Interval int64 `json:"interval"`
// contains filtered or unexported fields
}
func (LokiHook) GetColorful ¶ added in v0.4.3
func (e LokiHook) GetColorful() bool
type LokiReq ¶ added in v0.0.52
type LokiReq struct {
Streams []*LokiReq_Stream `json:"streams"`
}
type LokiReq_Stream ¶ added in v0.0.52
type RotationType ¶ added in v0.0.52
type RotationType string
type StdoutHook ¶ added in v0.4.0
func (StdoutHook) GetColorful ¶ added in v0.4.3
func (e StdoutHook) GetColorful() bool
func (StdoutHook) GetFormat ¶ added in v0.4.3
func (e StdoutHook) GetFormat() LogFormat
func (StdoutHook) Levels ¶ added in v0.4.0
func (e StdoutHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.