Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(ctx context.Context, tag string, format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(ctx context.Context, tag string, format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(ctx context.Context, tag string, format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(ctx context.Context, tag string, format string, args ...interface{})
- func NewWriter(config *FileConfig) (zerolog.LevelWriter, error)
- func Warn(args ...interface{})
- func Warnf(ctx context.Context, tag string, format string, args ...interface{})
- type DiLogHandle
- func (zlog *DiLogHandle) Debug(args ...interface{})
- func (zlog *DiLogHandle) Debugf(ctx context.Context, tag string, format string, args ...interface{})
- func (zlog *DiLogHandle) Error(args ...interface{})
- func (zlog *DiLogHandle) Errorf(ctx context.Context, tag string, format string, args ...interface{})
- func (zlog *DiLogHandle) Fatal(args ...interface{})
- func (zlog *DiLogHandle) Fatalf(ctx context.Context, tag string, format string, args ...interface{})
- func (zlog *DiLogHandle) Info(args ...interface{})
- func (zlog *DiLogHandle) Infof(ctx context.Context, tag string, format string, args ...interface{})
- func (zlog *DiLogHandle) RegisterContextFormat(ctxFmt func(ctx context.Context) string)
- func (zlog *DiLogHandle) Warn(args ...interface{})
- func (zlog *DiLogHandle) Warnf(ctx context.Context, tag string, format string, args ...interface{})
- type FileConfig
- type ICtxKey
- type PubLog
Constants ¶
View Source
const ( //LogTypeStdout :Log Type Stdout LogTypeStdout = "stdout" //LogTypeFile :Log Type File LogTypeFile = "file" )
Variables ¶
This section is empty.
Functions ¶
func NewWriter ¶
func NewWriter(config *FileConfig) (zerolog.LevelWriter, error)
Types ¶
type DiLogHandle ¶
var ( //Logger is defualt log ,and print to stdout, if want format context, use RegisterContextFormat Logger *DiLogHandle )
func NewLoggerWithCfg ¶
func NewLoggerWithCfg(config *FileConfig) (*DiLogHandle, error)
func (*DiLogHandle) Debug ¶
func (zlog *DiLogHandle) Debug(args ...interface{})
func (*DiLogHandle) Debugf ¶
func (zlog *DiLogHandle) Debugf(ctx context.Context, tag string, format string, args ...interface{})
func (*DiLogHandle) Error ¶
func (zlog *DiLogHandle) Error(args ...interface{})
func (*DiLogHandle) Errorf ¶
func (zlog *DiLogHandle) Errorf(ctx context.Context, tag string, format string, args ...interface{})
func (*DiLogHandle) Fatal ¶
func (zlog *DiLogHandle) Fatal(args ...interface{})
func (*DiLogHandle) Fatalf ¶
func (zlog *DiLogHandle) Fatalf(ctx context.Context, tag string, format string, args ...interface{})
func (*DiLogHandle) Info ¶
func (zlog *DiLogHandle) Info(args ...interface{})
func (*DiLogHandle) Infof ¶
func (zlog *DiLogHandle) Infof(ctx context.Context, tag string, format string, args ...interface{})
func (*DiLogHandle) RegisterContextFormat ¶
func (zlog *DiLogHandle) RegisterContextFormat(ctxFmt func(ctx context.Context) string)
func (*DiLogHandle) Warn ¶
func (zlog *DiLogHandle) Warn(args ...interface{})
type FileConfig ¶
type FileConfig struct { //auto clear the log AutoClear bool //separate will write wf log Separate bool //file directory FileDir string //file prefix name FilePrefix string //clear hours ClearHours int32 //clear steps ClearStep int32 //is Disable link DisableLink bool // log level Level string // logtype is file or stdout LogType string }
type PubLog ¶
func NewPubLogger ¶
func NewPubLogger(config *FileConfig) (*PubLog, error)
func (*PubLog) PublicString ¶
PublicString will log string directly
Click to show internal directories.
Click to hide internal directories.