Documentation ¶
Index ¶
- Constants
- func Debug(msg string, args ...zap.Field)
- func Debugf(format string, args ...interface{})
- func Error(msg string, args ...zap.Field)
- func Errorf(format string, args ...interface{})
- func Fatal(msg string, args ...zap.Field)
- func Fatalf(format string, args ...interface{})
- func Info(msg string, args ...zap.Field)
- func Infof(format string, args ...interface{})
- func NewSentryCore(cfg sentryCoreConfig, sentryClient *sentry.Client) *core
- func Warn(msg string, args ...zap.Field)
- func Warnf(format string, args ...interface{})
- func With(k string, v interface{}) zap.Field
- func WithError(err error) zap.Field
- type Log
- type LogOptions
- func (c *LogOptions) CloseConsoleDisplay()
- func (c *LogOptions) InitLogger() *Log
- func (c *LogOptions) SetCaller(b bool)
- 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 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 NewSentryCore ¶ added in v0.2.4
func NewSentryCore(cfg sentryCoreConfig, sentryClient *sentry.Client) *core
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" 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"` 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"` // 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() *Log
func (*LogOptions) SetCaller ¶
func (c *LogOptions) SetCaller(b bool)
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 SentryLoggerConfig ¶ added in v0.2.4
Click to show internal directories.
Click to hide internal directories.