Documentation ¶
Index ¶
- Constants
- func ChangeJsCaller(call int)
- func ChangeJtCaller(call int)
- func NewCircularFifoQueue(maxSize uint) *circularFifoQueue
- func NewSentryCore(cfg sentryCoreConfig, sentryClient *sentry.Client) *core
- func NewStats() *stats
- type Log
- func (c *Log) Close() *Log
- func (c *Log) Debug(msg string, args ...zap.Field)
- func (c *Log) Debugf(format string, args ...interface{})
- func (c *Log) ErrEf(err error, format string, args ...interface{})
- func (c *Log) Error(msg string, args ...zap.Field)
- func (c *Log) ErrorE(err error, format string, args ...interface{})
- func (c *Log) Errorf(format string, args ...interface{})
- func (c *Log) Fatal(msg string, args ...zap.Field)
- func (c *Log) Fatalf(format string, args ...interface{})
- func (c *Log) Info(msg string, args ...zap.Field)
- func (c *Log) Infof(format string, args ...interface{})
- func (c *Log) ViewQueueFunc(w http.ResponseWriter, r *http.Request)
- func (c *Log) ViewStatsFunc(w http.ResponseWriter, r *http.Request)
- func (c *Log) Warn(msg string, args ...zap.Field)
- func (c *Log) Warnf(format string, args ...interface{})
- func (c *Log) With(k string, v interface{}) zap.Field
- func (c *Log) WithError(err error) zap.Field
- type LogOptions
- func (c *LogOptions) AddField(k string, v any)
- func (c *LogOptions) CloseConsoleDisplay()
- func (c *LogOptions) ErrorQueue() *circularFifoQueue
- func (c *LogOptions) GetStats() *stats
- func (c *LogOptions) InfoQueue() *circularFifoQueue
- func (c *LogOptions) InitLogger() *Log
- func (c *LogOptions) QueueSize() uint
- func (c *LogOptions) SetCaller(b bool)
- func (c *LogOptions) SetCallerSkip(skip int)
- func (c *LogOptions) SetDivision(division string)
- func (c *LogOptions) SetEnableQueue(enableQueue bool)
- func (c *LogOptions) SetEnableStats(enable bool)
- func (c *LogOptions) SetEncoding(encoding string)
- func (c *LogOptions) SetErrorFile(path string)
- func (c *LogOptions) SetInfoFile(path string)
- func (c *LogOptions) SetQueueSize(queueSize uint)
- func (c *LogOptions) SetStatsClearIntervalDay(statsClearIntervalDay uint8)
- func (c *LogOptions) SetStatsFormat(format string)
- func (c *LogOptions) SetTimeUnit(t TimeUnit)
- type SentryLoggerConfig
- type TimeUnit
Constants ¶
View Source
const ( TimeDivision = "time" SizeDivision = "size" )
View Source
const ( Minute = "minute" Hour = "hour" Day = "day" Month = "month" Year = "year" )
Variables ¶
This section is empty.
Functions ¶
func ChangeJsCaller ¶
func ChangeJsCaller(call int)
func ChangeJtCaller ¶
func ChangeJtCaller(call int)
func NewCircularFifoQueue ¶
func NewCircularFifoQueue(maxSize uint) *circularFifoQueue
func NewSentryCore ¶
func NewSentryCore(cfg sentryCoreConfig, sentryClient *sentry.Client) *core
NewSentryCore 生成Core对象
Types ¶
type Log ¶
type Log struct { L *zap.Logger Op *LogOptions }
func (*Log) ViewQueueFunc ¶
func (c *Log) ViewQueueFunc(w http.ResponseWriter, r *http.Request)
func (*Log) ViewStatsFunc ¶
func (c *Log) ViewStatsFunc(w http.ResponseWriter, r *http.Request)
type LogOptions ¶
type LogOptions struct { // Encoding sets the logger's encoding. Valid values are "json" and // "console", as well as any third-party encodings registered via // RegisterEncoder. Encoding string `json:"encoding" yaml:"encoding" toml:"encoding"` InfoFilename string `json:"info_filename" yaml:"info_filename" toml:"info_filename"` ErrorFilename string `json:"error_filename" yaml:"error_filename" toml:"error_filename"` MaxSize int `json:"max_size" yaml:"max_size" toml:"max_size"` // mb 默认100mb MaxBackups int `json:"max_backups" yaml:"max_backups" toml:"max_backups"` MaxAge int `json:"max_age" yaml:"max_age" toml:"max_age"` // day 默认不限 Compress bool `json:"compress" yaml:"compress" toml:"compress"` Division string `json:"division" yaml:"division" toml:"division"` LevelSeparate bool `json:"level_separate" yaml:"level_separate" toml:"level_separate"` TimeUnit TimeUnit `json:"time_unit" yaml:"time_unit" toml:"time_unit"` Stacktrace bool `json:"stacktrace" yaml:"stacktrace" toml:"stacktrace"` SentryConfig SentryLoggerConfig `json:"sentry_config" yaml:"sentry_config" toml:"sentry_config"` Fields []zap.Field `json:"fields,omitempty" yaml:"fields" toml:"fields"` // contains filtered or unexported fields }
func New ¶
func New() *LogOptions
func (*LogOptions) AddField ¶
func (c *LogOptions) AddField(k string, v any)
func (*LogOptions) CloseConsoleDisplay ¶
func (c *LogOptions) CloseConsoleDisplay()
func (*LogOptions) ErrorQueue ¶
func (c *LogOptions) ErrorQueue() *circularFifoQueue
func (*LogOptions) GetStats ¶
func (c *LogOptions) GetStats() *stats
func (*LogOptions) InfoQueue ¶
func (c *LogOptions) InfoQueue() *circularFifoQueue
func (*LogOptions) InitLogger ¶
func (c *LogOptions) InitLogger() *Log
func (*LogOptions) QueueSize ¶
func (c *LogOptions) QueueSize() uint
func (*LogOptions) SetCaller ¶
func (c *LogOptions) SetCaller(b bool)
func (*LogOptions) SetCallerSkip ¶
func (c *LogOptions) SetCallerSkip(skip int)
func (*LogOptions) SetDivision ¶
func (c *LogOptions) SetDivision(division string)
func (*LogOptions) SetEnableQueue ¶
func (c *LogOptions) SetEnableQueue(enableQueue bool)
func (*LogOptions) SetEnableStats ¶
func (c *LogOptions) SetEnableStats(enable bool)
func (*LogOptions) SetEncoding ¶
func (c *LogOptions) SetEncoding(encoding string)
func (*LogOptions) SetErrorFile ¶
func (c *LogOptions) SetErrorFile(path string)
func (*LogOptions) SetInfoFile ¶
func (c *LogOptions) SetInfoFile(path string)
func (*LogOptions) SetQueueSize ¶
func (c *LogOptions) SetQueueSize(queueSize uint)
func (*LogOptions) SetStatsClearIntervalDay ¶
func (c *LogOptions) SetStatsClearIntervalDay(statsClearIntervalDay uint8)
func (*LogOptions) SetStatsFormat ¶
func (c *LogOptions) SetStatsFormat(format string)
func (*LogOptions) SetTimeUnit ¶
func (c *LogOptions) SetTimeUnit(t TimeUnit)
type SentryLoggerConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.