Documentation
¶
Index ¶
- func Debug(args ...any)
- func Debugf(template string, args ...any)
- func Error(args ...any)
- func Errorf(template string, args ...any)
- func Fatal(args ...any)
- func Fatalf(template string, args ...any)
- func FromZap(zLogger *zap.Logger) *pLogger
- func GetDefaultLogger() kLog.Logger
- func GetDefaultLoggerNoCaller() kLog.Logger
- func GetLoggerLevel() zapcore.Level
- func Info(args ...any)
- func Infof(template string, args ...any)
- func InitConsoleLogger()
- func InitFromConfig(isLogConsole bool)
- func InitLogger(isLogConsole bool, lv zapcore.Level, logPath string)
- func LogErr(err error) error
- func LogErrMsg(errMsg string) error
- func LogErrNo(errNo int32) int32
- func LogErrNoToErr(errNo int32) error
- func LogErrToErrNo(err error, errNo int32) int32
- func LogErrfMsg(format string, args ...any) error
- func NewGraylogCore(addr string) zapcore.Core
- func NewTimeLogger(name string) *timeLogger
- func SetDefaultLogger(l kLog.Logger)
- func SetJsonLog(isJson bool)
- func SetLoggerLevel(lv string)
- func SetPrefixKeys(keys ...string)
- func StrToLoggerLevel(lvl string) zapcore.Level
- func Warn(args ...any)
- func Warnf(template string, args ...any)
- type GraylogCore
- type PLogWarper
- func (l *PLogWarper) AddCallerLevel(callerLevel int) *PLogWarper
- func (l *PLogWarper) Debug(args ...any)
- func (l *PLogWarper) Debugf(template string, args ...any)
- func (l *PLogWarper) Error(args ...any)
- func (l *PLogWarper) Errorf(template string, args ...any)
- func (l *PLogWarper) Fatal(args ...any)
- func (l *PLogWarper) Fatalf(template string, args ...any)
- func (l *PLogWarper) GetLogger() kLogger.Logger
- func (l *PLogWarper) Info(args ...any)
- func (l *PLogWarper) Infof(template string, args ...any)
- func (l *PLogWarper) LogErr(err error) error
- func (l *PLogWarper) LogErrMsg(errMsg string) error
- func (l *PLogWarper) LogErrNo(errNo int32) int32
- func (l *PLogWarper) LogErrNoToErr(errNo int32) error
- func (l *PLogWarper) LogErrToErrNo(err error, errNo int32) int32
- func (l *PLogWarper) LogErrfMsg(format string, args ...any) error
- func (l *PLogWarper) Warn(args ...any)
- func (l *PLogWarper) Warnf(template string, args ...any)
- func (l *PLogWarper) WithContext(ctx context.Context) *PLogWarper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultLogger ¶ added in v0.0.6
func GetDefaultLoggerNoCaller ¶ added in v0.0.6
func GetLoggerLevel ¶
func InitConsoleLogger ¶
func InitConsoleLogger()
func InitFromConfig ¶ added in v0.0.6
func InitFromConfig(isLogConsole bool)
--------------------------------------------------
func LogErrNoToErr ¶ added in v0.0.6
func LogErrToErrNo ¶ added in v0.0.6
func LogErrfMsg ¶ added in v0.0.6
func NewGraylogCore ¶ added in v0.0.6
func NewTimeLogger ¶
func NewTimeLogger(name string) *timeLogger
func SetDefaultLogger ¶ added in v0.0.6
除了默认的初始化外,也可以修改后覆盖默认的logger
func SetJsonLog ¶ added in v0.0.6
func SetJsonLog(isJson bool)
func SetPrefixKeys ¶ added in v0.0.6
func SetPrefixKeys(keys ...string)
func StrToLoggerLevel ¶ added in v0.0.6
Types ¶
type GraylogCore ¶ added in v0.0.6
type GraylogCore struct {
zapcore.LevelEnabler
// contains filtered or unexported fields
}
graylog其实没有想象中那么好用,因为UI算是比较简陋了一点 实现zapcore.Core接口以获得日志level
func (*GraylogCore) Check ¶ added in v0.0.6
func (c *GraylogCore) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
func (*GraylogCore) Sync ¶ added in v0.0.6
func (c *GraylogCore) Sync() error
type PLogWarper ¶ added in v0.0.6
type PLogWarper struct {
// contains filtered or unexported fields
}
func GetDefaultLogWarper ¶ added in v0.0.6
func GetDefaultLogWarper() *PLogWarper
func NewPLogWarper ¶ added in v0.0.6
func NewPLogWarper(kLog kLogger.Logger) *PLogWarper
func (*PLogWarper) AddCallerLevel ¶ added in v0.0.6
func (l *PLogWarper) AddCallerLevel(callerLevel int) *PLogWarper
func (*PLogWarper) Debug ¶ added in v0.0.6
func (l *PLogWarper) Debug(args ...any)
--------------------------------------------------
func (*PLogWarper) Debugf ¶ added in v0.0.6
func (l *PLogWarper) Debugf(template string, args ...any)
func (*PLogWarper) Error ¶ added in v0.0.6
func (l *PLogWarper) Error(args ...any)
--------------------------------------------------
func (*PLogWarper) Errorf ¶ added in v0.0.6
func (l *PLogWarper) Errorf(template string, args ...any)
func (*PLogWarper) Fatal ¶ added in v0.0.6
func (l *PLogWarper) Fatal(args ...any)
--------------------------------------------------
func (*PLogWarper) Fatalf ¶ added in v0.0.6
func (l *PLogWarper) Fatalf(template string, args ...any)
func (*PLogWarper) GetLogger ¶ added in v0.0.6
func (l *PLogWarper) GetLogger() kLogger.Logger
func (*PLogWarper) Info ¶ added in v0.0.6
func (l *PLogWarper) Info(args ...any)
--------------------------------------------------
func (*PLogWarper) Infof ¶ added in v0.0.6
func (l *PLogWarper) Infof(template string, args ...any)
func (*PLogWarper) LogErr ¶ added in v0.0.6
func (l *PLogWarper) LogErr(err error) error
func (*PLogWarper) LogErrMsg ¶ added in v0.0.6
func (l *PLogWarper) LogErrMsg(errMsg string) error
--------------------------------------------------
func (*PLogWarper) LogErrNo ¶ added in v0.0.6
func (l *PLogWarper) LogErrNo(errNo int32) int32
务必定义0表示成功
func (*PLogWarper) LogErrNoToErr ¶ added in v0.0.6
func (l *PLogWarper) LogErrNoToErr(errNo int32) error
func (*PLogWarper) LogErrToErrNo ¶ added in v0.0.6
func (l *PLogWarper) LogErrToErrNo(err error, errNo int32) int32
func (*PLogWarper) LogErrfMsg ¶ added in v0.0.6
func (l *PLogWarper) LogErrfMsg(format string, args ...any) error
func (*PLogWarper) Warn ¶ added in v0.0.6
func (l *PLogWarper) Warn(args ...any)
--------------------------------------------------
func (*PLogWarper) Warnf ¶ added in v0.0.6
func (l *PLogWarper) Warnf(template string, args ...any)
func (*PLogWarper) WithContext ¶ added in v0.0.6
func (l *PLogWarper) WithContext(ctx context.Context) *PLogWarper
Click to show internal directories.
Click to hide internal directories.