Documentation
¶
Index ¶
- Constants
- Variables
- func DPanic(msg string, fields ...Field)
- func DPanicf(msg string, args ...interface{})
- func DPanicw(msg string, keysAndValues ...interface{})
- func Debug(msg string, fields ...Field)
- func Debugf(msg string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func DefaultConfig() *config
- func Error(msg string, fields ...Field)
- func Errorf(msg string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(msg string, fields ...Field)
- func Fatalf(msg string, args ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Info(msg string, fields ...Field)
- func Infof(msg string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Panic(msg string, fields ...Field)
- func Panicf(msg string, args ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func SetDefaultLogger(l *GalaxyLog)
- func Warn(msg string, fields ...Field)
- func Warnf(msg string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Field
- func FieldAddr(value string) Field
- func FieldApp(value string) Field
- func FieldCode(value int32) Field
- func FieldComponent(value string) Field
- func FieldComponentName(value string) Field
- func FieldCost(value time.Duration) Field
- func FieldCustomKeyValue(key string, value string) Field
- func FieldDescription(value string) Field
- func FieldErr(err error) Field
- func FieldErrAny(err interface{}) Field
- func FieldErrKind(value string) Field
- func FieldEvent(value string) Field
- func FieldExtMessage(vals ...interface{}) Field
- func FieldIP(value string) Field
- func FieldKey(value string) Field
- func FieldKind(value string) Field
- func FieldMethod(value string) Field
- func FieldName(value string) Field
- func FieldPeerIP(value string) Field
- func FieldPeerName(value string) Field
- func FieldSize(value int32) Field
- func FieldStack(value []byte) Field
- func FieldTid(value string) Field
- func FieldType(value string) Field
- func FieldValue(value string) Field
- func FieldValueAny(value interface{}) Field
- type GalaxyLog
- func (g *GalaxyLog) AutoLevel(c *gxyconfig.Configuration)
- func (g *GalaxyLog) DPanic(msg string, fields ...Field)
- func (g *GalaxyLog) DPanicf(template string, args ...interface{})
- func (g *GalaxyLog) DPanicw(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) Debug(msg string, fields ...Field)
- func (g *GalaxyLog) Debugf(template string, args ...interface{})
- func (g *GalaxyLog) Debugw(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) Error(msg string, fields ...Field)
- func (g *GalaxyLog) Errorf(template string, args ...interface{})
- func (g *GalaxyLog) Errorw(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) Fatal(msg string, fields ...Field)
- func (g *GalaxyLog) Fatalf(template string, args ...interface{})
- func (g *GalaxyLog) Fatalw(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) Flush() error
- func (g *GalaxyLog) Info(msg string, fields ...Field)
- func (g *GalaxyLog) Infof(template string, args ...interface{})
- func (g *GalaxyLog) Infow(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) Panic(msg string, fields ...Field)
- func (g *GalaxyLog) Panicf(template string, args ...interface{})
- func (g *GalaxyLog) Panicw(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) SetLevel(lv Level)
- func (g *GalaxyLog) StdLog() *log.Logger
- func (g *GalaxyLog) Warn(msg string, fields ...Field)
- func (g *GalaxyLog) Warnf(template string, args ...interface{})
- func (g *GalaxyLog) Warnw(msg string, keysAndValues ...interface{})
- func (g *GalaxyLog) With(fields ...Field) *GalaxyLog
- func (g *GalaxyLog) WithCallerSkip(callerSkip int, fields ...Field) *GalaxyLog
- type Level
- type Option
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel = zap.DebugLevel // InfoLevel is the default logging priority. InfoLevel = zap.InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel = zap.WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-Level logs. ErrorLevel = zap.ErrorLevel // PanicLevel logs a message, then panics. PanicLevel = zap.PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = zap.FatalLevel )
Variables ¶
View Source
var ( // String alias for zap.String String = zap.String // Any alias for zap.Any Any = zap.Any // Int64 alias for zap.Int64 Int64 = zap.Int64 // Int alias for zap.Int Int = zap.Int // Int32 alias for zap.Int32 Int32 = zap.Int32 // Uint alias for zap.Uint Uint = zap.Uint // Duration alias for zap.Duration Duration = zap.Duration // Durationp alias for zap.Duration Durationp = zap.Durationp // Object alias for zap.Object Object = zap.Object // Namespace alias for zap.Namespace Namespace = zap.Namespace // Reflect alias for zap.Reflect Reflect = zap.Reflect // Skip alias for zap.Skip() Skip = zap.Skip() // ByteString alias for zap.ByteString ByteString = zap.ByteString )
Functions ¶
func DefaultConfig ¶
func DefaultConfig() *config
func SetDefaultLogger ¶
func SetDefaultLogger(l *GalaxyLog)
Types ¶
type GalaxyLog ¶
type GalaxyLog struct {
// contains filtered or unexported fields
}
func DefaultLogger ¶
func DefaultLogger() *GalaxyLog
func NewLogger ¶
func NewLogger(name string, configure *gxyconfig.Configuration, opts ...Option) *GalaxyLog
func (*GalaxyLog) AutoLevel ¶
func (g *GalaxyLog) AutoLevel(c *gxyconfig.Configuration)
AutoLevel ...
func (*GalaxyLog) Flush ¶
Flush ... When use os.Stdout or os.Stderr as zapcore.WriteSyncer g.desugar.Sync() maybe return an error like this: 'sync /dev/stdout: The handle is invalid.' Because os.Stdout and os.Stderr is a non-normal file, maybe not support 'fsync' in different os platform So ignored Sync() return value About issues: https://github.com/uber-go/zap/issues/328 About 'fsync': https://man7.org/linux/man-pages/man2/fsync.2.html
type Option ¶
type Option func(g *GalaxyLog)
Option 可选项
func WithEnableAddCaller ¶
WithEnableAddCaller 是否添加行号,默认不添加行号
Click to show internal directories.
Click to hide internal directories.