Documentation ¶
Index ¶
- Variables
- func MessageDroped() int64
- func MessageRemaining() int
- func NewOption(opts ...FileOptionHandle) *fileWriterOption
- func NewTracingLog(logDir string) error
- func SetGlobalLevel(lv int, d time.Duration)
- func SetWarnFunc(f func(string))
- func TailLog(fileName string) chan string
- type FileOptionHandle
- func WithAsync(b bool) FileOptionHandle
- func WithClone(c io.Writer) FileOptionHandle
- func WithCompress(count, keep int) FileOptionHandle
- func WithLabel(l string) FileOptionHandle
- func WithName(n string) FileOptionHandle
- func WithPath(p string) FileOptionHandle
- func WithWarnDropNumber(w1, w2, dn int) FileOptionHandle
- type FileWriter
- type Handler
- func (o *Handler) Debug(file ...string) *zerolog.Event
- func (o *Handler) Err(err error, file ...string) *zerolog.Event
- func (o *Handler) Error(file ...string) *zerolog.Event
- func (o *Handler) File(file ...string) *zlog
- func (o *Handler) GetLevel() (res []LogLevel)
- func (o *Handler) Info(file ...string) *zerolog.Event
- func (o *Handler) Log(file ...string) *zerolog.Event
- func (o *Handler) Panic(file ...string) *zerolog.Event
- func (o *Handler) RouteWithLogTo(file string, ...) http.HandlerFunc
- func (o *Handler) SetDefaultLevel(lv int)
- func (o *Handler) SetLevel(lv int, d ...time.Duration)
- func (o *Handler) Trace(file ...string) *zerolog.Event
- func (o *Handler) Warn(file ...string) *zerolog.Event
- func (o *Handler) WithLevel(level zerolog.Level, file ...string) *zerolog.Event
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TraceLogger *zap.Logger
)
Functions ¶
func NewOption ¶
func NewOption(opts ...FileOptionHandle) *fileWriterOption
func NewTracingLog ¶
func SetGlobalLevel ¶
Types ¶
type FileOptionHandle ¶
type FileOptionHandle func(*fileWriterOption)
func WithAsync ¶
func WithAsync(b bool) FileOptionHandle
func WithClone ¶
func WithClone(c io.Writer) FileOptionHandle
func WithCompress ¶
func WithCompress(count, keep int) FileOptionHandle
func WithLabel ¶
func WithLabel(l string) FileOptionHandle
func WithName ¶
func WithName(n string) FileOptionHandle
func WithPath ¶
func WithPath(p string) FileOptionHandle
func WithWarnDropNumber ¶
func WithWarnDropNumber(w1, w2, dn int) FileOptionHandle
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
FileWriter ...
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewAsyncHandler ¶
func NewAsyncHandler(path, label string, clone io.Writer, count, keep int, defaultlevel ...int) *Handler
NewAsyncHandler 异步io的日志句柄
func NewHandler ¶
NewHandler 同步io的日志句柄
func (*Handler) RouteWithLogTo ¶
func (o *Handler) RouteWithLogTo(file string, do func(w http.ResponseWriter, r *http.Request, et *zerolog.Event), aggCost ...bool) http.HandlerFunc
RouteWithLogTo 路由包装,日志输出到指定文件中
func (*Handler) SetDefaultLevel ¶
修改某一业务日志的默认级别,所有操作对象的级别变更到不低于新的默认级别
Click to show internal directories.
Click to hide internal directories.