Documentation
¶
Index ¶
- Constants
- func KeysAndValues(data interface{}) []interface{}
- func NewSentryCore(cfg sentryCoreConfig, sentryClient *sentry.Client) *core
- func With(k string, v interface{}) zap.Field
- func WithError(err error) zap.Field
- type Log
- func (log *Log) Debug(msg string, args ...zap.Field)
- func (log *Log) Debugf(format string, args ...interface{})
- func (log *Log) Error(msg string, args ...zap.Field)
- func (log *Log) Errorf(format string, args ...interface{})
- func (log *Log) Fatal(msg string, args ...zap.Field)
- func (log *Log) Fatalf(format string, args ...interface{})
- func (log *Log) Info(msg string, args ...zap.Field)
- func (log *Log) Infof(format string, args ...interface{})
- func (log *Log) Sugar() *zap.SugaredLogger
- func (log *Log) Warn(msg string, args ...zap.Field)
- func (log *Log) Warnf(format string, args ...interface{})
- type LogOptions
- func (c *LogOptions) CloseConsoleDisplay()
- func (c *LogOptions) InitLogger(timeKey, levelKey string, customEncodeTime, shortCaller bool) *Log
- func (c *LogOptions) InitSampleLogger(timeKey, levelKey string, customEncodeTime, shortCaller bool) *SampleLog
- func (c *LogOptions) SetCaller(enable bool, skip int)
- func (c *LogOptions) SetDivision(division string)
- func (c *LogOptions) SetEncoding(encoding string)
- func (c *LogOptions) SetErrorFile(path string)
- func (c *LogOptions) SetInfoFile(path string)
- func (c *LogOptions) SetTimeUnit(t TimeUnit)
- type SampleLog
- func (log *SampleLog) Debug(msg string, args ...zap.Field)
- func (log *SampleLog) Debugf(format string, args ...interface{})
- func (log *SampleLog) Error(msg string, args ...zap.Field)
- func (log *SampleLog) Errorf(format string, args ...interface{})
- func (log *SampleLog) Fatal(msg string, args ...zap.Field)
- func (log *SampleLog) Fatalf(format string, args ...interface{})
- func (log *SampleLog) Info(msg string, args ...zap.Field)
- func (log *SampleLog) Infof(format string, args ...interface{})
- func (log *SampleLog) Sugar() *zap.SugaredLogger
- func (log *SampleLog) Warn(msg string, args ...zap.Field)
- func (log *SampleLog) Warnf(format string, args ...interface{})
- 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 KeysAndValues ¶ added in v0.4.0
func KeysAndValues(data interface{}) []interface{}
func NewSentryCore ¶ added in v0.2.4
NewSentryCore 生成Core对象
Types ¶
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,omitempty" yaml:"encoding,omitempty" toml:"encoding,omitempty"`
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"`
MaxBackups int `json:"max_backups" yaml:"max_backups" toml:"max_backups"`
MaxAge int `json:"max_age" yaml:"max_age" toml:"max_age"`
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"`
Level int8 `json:"level" yaml:"level" toml:"level"`
CloseDisplay int `json:"close_display" yaml:"close_display" toml:"close_display"`
SampleRate float64 `json:"sample_rate,omitempty" yaml:"sample_rate,omitempty" toml:"sample_rate,omitempty"`
// contains filtered or unexported fields
}
func New ¶
func New() *LogOptions
func NewFromJson ¶
func NewFromJson(confPath string) *LogOptions
func NewFromToml ¶
func NewFromToml(confPath string) *LogOptions
func NewFromYaml ¶
func NewFromYaml(confPath string) *LogOptions
func (*LogOptions) CloseConsoleDisplay ¶
func (c *LogOptions) CloseConsoleDisplay()
func (*LogOptions) InitLogger ¶
func (c *LogOptions) InitLogger(timeKey, levelKey string, customEncodeTime, shortCaller bool) *Log
func (*LogOptions) InitSampleLogger ¶ added in v0.3.1
func (c *LogOptions) InitSampleLogger(timeKey, levelKey string, customEncodeTime, shortCaller bool) *SampleLog
func (*LogOptions) SetCaller ¶
func (c *LogOptions) SetCaller(enable bool, skip int)
func (*LogOptions) SetDivision ¶
func (c *LogOptions) SetDivision(division string)
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) SetTimeUnit ¶
func (c *LogOptions) SetTimeUnit(t TimeUnit)
type SampleLog ¶ added in v0.3.1
func (*SampleLog) Sugar ¶ added in v0.4.0
func (log *SampleLog) Sugar() *zap.SugaredLogger
type SentryLoggerConfig ¶ added in v0.2.4
Click to show internal directories.
Click to hide internal directories.