Versions in this module Expand all Collapse all v1 v1.2.0 May 31, 2024 v1.1.1 May 31, 2024 v1.0.1 May 31, 2024 v1.0.0 Mar 28, 2023 Changes in this version + const DurationFieldInteger + const DurationFieldUnit + const MagicNum + const Version + var Must muster + var StderrHandler = StreamHandler(os.Stderr, LogfmtFormat()) + var StdoutHandler = StreamHandler(os.Stdout, LogfmtFormat()) + func Crit(msg string, ctx ...interface{}) + func Debug(msg string, ctx ...interface{}) + func DeleteMetaForGoroutine() + func Error(msg string, ctx ...interface{}) + func GetReqContextForGoroutine() (context.Context, bool) + func GetReqIDForGoroutine() (interface{}, bool) + func GormInfo(msg string, caller string, ctx ...interface{}) + func Info(msg string, ctx ...interface{}) + func LogRotate() + func MetaDebug(msg string, metaType Meta, metaData interface{}, ctx ...interface{}) + func SetOutLevel(level Lvl) + func SetReqMetaForGoroutine(ctx context.Context, ID interface{}) + func SetRotatePara(maxsize, maxage, maxbackup int, compress bool) + func Warn(msg string, ctx ...interface{}) + type Ctx map[string]interface + type Format interface + Format func(r *Record) []byte + func FormatFunc(f func(*Record) []byte) Format + func JsonFormat() Format + func JsonFormatEx(pretty, lineSeparated bool) Format + func LogfmtFormat() Format + func TerminalFormat() Format + type Handler interface + Log func(r *Record) error + func BufferedHandler(bufSize int, h Handler) Handler + func CallerFileHandler(h Handler) Handler + func CallerFuncHandler(h Handler) Handler + func ChannelHandler(recs chan<- *Record) Handler + func DiscardHandler() Handler + func FailoverHandler(hs ...Handler) Handler + func FileHandler(path string, fmtr Format) (Handler, error) + func FilterHandler(fn func(r *Record) bool, h Handler) Handler + func FuncHandler(fn func(r *Record) error) Handler + func LazyHandler(h Handler) Handler + func LvlFilterHandler(maxLvl Lvl, h Handler) Handler + func MatchFilterHandler(key string, value interface{}, h Handler) Handler + func MultiHandler(hs ...Handler) Handler + func NetFileHandler(path, serviceName string, fmtr Format, opts ...Option) (Handler, error) + func NetHandler(network, addr string, fmtr Format) (Handler, error) + func SelfStreamHandler(wr io.Writer, fmtr Format) Handler + func StreamHandler(wr io.Writer, fmtr Format) Handler + func SyncHandler(h Handler) Handler + func SyslogHandler(priority syslog.Priority, tag string, fmtr Format) (Handler, error) + func SyslogNetHandler(net, addr string, priority syslog.Priority, tag string, fmtr Format) (Handler, error) + type HelloPacket struct + ServiceName string + type Lazy struct + Fn interface{} + type Logger interface + Crit func(msg string, ctx ...interface{}) + Debug func(msg string, ctx ...interface{}) + Error func(msg string, ctx ...interface{}) + GetHandler func() Handler + Info func(msg string, ctx ...interface{}) + New func(ctx ...interface{}) Logger + SetHandler func(h Handler) + SetOutLevel func(l Lvl) + Warn func(msg string, ctx ...interface{}) + func New(ctx ...interface{}) Logger + func Root() Logger + type Lvl int + const LvlCrit + const LvlDebug + const LvlError + const LvlInfo + const LvlWarn + func LvlFromString(lvlString string) (Lvl, error) + func (l Lvl) String() string + type Meta int + const BaseMonitor + const Order + func (m Meta) String() string + type MsgType uint8 + const Data_Packet + const Hello_Packet + type Option func(u *UDPLogger) + func WithDstAddr(dstAddr string) Option + type Record struct + Call string + Ctx []interface{} + CustomCaller string + KeyNames RecordKeyNames + Lvl Lvl + MetaK string + MetaV string + Msg string + RequestID string + Time time.Time + type RecordKeyNames struct + Call string + Lvl string + Msg string + ReqID string + Time string + type UDPLogger struct + WriteBuf []byte + func (u *UDPLogger) Close() error + func (u *UDPLogger) Write(p []byte) (n int, err error)