package
0.0.0-20201215110546-04adac5990ce
Repository: https://github.com/cebrains/jupiter.git
Documentation: pkg.go.dev

# README

xlog

xlog wrapped go.uber.org/zap, simplify the difficulty of use.

动态设置日志级别

修改默认日志级别:

[jupiter.logger.default]
    level = "error"

修改自定义日志界别:

[jupiter.logger.mylog]
    level = "error"

创建自定义日志

logger := xlog.StdConfig("mylog").Build()
logger.Info("info", xlog.String("a", "b"))
logger.Infof("info %s", "a")
logger.Infow("info", "a", "b")

也可以更精确的控制:

config := xlog.Config{
    Name: "default.log",
    Dir: "/tmp",
    Level: "info",
}
logger := config.Build()
logger.SetLevel(xlog.DebugLevel)
logger.Debug("debug", xlog.String("a", "b"))
logger.Debugf("debug %s", "a")
logger.Debugw("debug", "a", "b")

# Packages

No description provided by the author

# Functions

Auto ...
Buffer wraps a WriteSyncer in a buffer to improve performance, if bufferSize = 0, we set it to defaultBufferSize if flushInterval = 0, we set it to defaultFlushInterval.
Debug ...
DebugEncodeLevel ...
Debugf ...
Debugw ...
DefaultConfig ...
DefaultZapConfig ...
DPanic ...
DPanicf ...
DPanicw ...
Error ...
Errorf ...
Errorw ...
ExtractTraceMD ...
Fatal ...
Fatalf ...
Fatalw ...
依赖的实例名称。以mysql为例,"dsn = "root:juno@tcp(127.0.0.1:3306)/juno?charset=utf8",addr为 "127.0.0.1:3306".
FieldAddrAny ...
应用唯一标识符.
FieldCode ...
耗时时间.
FieldErr ...
FieldErrKind ...
FieldEvent ...
FieldExtMessage ...
FieldKey ...
耗时时间.
FieldMethod ...
模块.
FieldName ...
FieldStack ...
FieldErr ...
FieldType ...
FieldValue ...
FieldValueAny ...
Info ...
Infof ...
Infow ...
InjectTraceMD ...
NewContext ...
NewTracer ...
Panic ...
Panicf ...
Panicw ...
RawConfig ...
StdConfig Jupiter Standard logger config.
Warn ...
Warnf ...
Warnw ...
With ...

# Constants

DebugLevel logs are typically voluminous, and are usually disabled in production.
ErrorLevel logs are high-priority.
FatalLevel logs a message, then calls os.Exit(1).
InfoLevel is the default logging priority.
PanicLevel logs a message, then panics.
WarnLevel logs are more important than Info, but don't need individual human review.

# Variables

Any ...
ByteString ...
DefaultLogger default logger Biz Log debug=true as default, will be.
Duration ...
Durationp ...
Int ...
Int32 ...
Int64 ...
frame logger.
Namespace ...
Object ...
Reflect ...
Skip ...
String ...
Uint ...

# Structs

Config ...
Func ...
Tracer ...

# Type aliases

CloseFunc should be called when the caller exits to clean up buffers.
Func ...
Func ...
Func ...