Documentation ¶
Index ¶
- Constants
- func Debug(msg string, v ...interface{})
- func DebugWithField(msg string, v ...zap.Field)
- func DebugWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func DebugWithStruct(obj interface{}, msg string, v ...interface{})
- func Error(msg string, v ...interface{})
- func ErrorWithField(msg string, v ...zap.Field)
- func ErrorWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func ErrorWithStruct(obj interface{}, msg string, v ...interface{})
- func Info(msg string, v ...interface{})
- func InfoWithField(msg string, v ...zap.Field)
- func InfoWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func InfoWithStruct(obj interface{}, msg string, v ...interface{})
- func InitLogger(path, file string, level int)
- func LDebug(name string, msg string, v ...interface{})
- func LDebugWithField(name string, msg string, v ...zap.Field)
- func LDebugWithMap(name string, obj map[string]interface{}, msg string, v ...interface{})
- func LDebugWithStruct(name string, obj interface{}, msg string, v ...interface{})
- func LError(name string, msg string, v ...interface{})
- func LErrorWithField(name string, msg string, v ...zap.Field)
- func LErrorWithMap(name string, obj map[string]interface{}, msg string, v ...interface{})
- func LErrorWithStruct(name string, obj interface{}, msg string, v ...interface{})
- func LInfo(name string, msg string, v ...interface{})
- func LInfoWithField(name string, msg string, v ...zap.Field)
- func LInfoWithMap(name string, obj map[string]interface{}, msg string, v ...interface{})
- func LInfoWithStruct(name string, obj interface{}, msg string, v ...interface{})
- func LPanic(name string, msg string, v ...interface{})
- func LPanicWithField(name string, msg string, v ...zap.Field)
- func LPanicWithMap(name string, obj map[string]interface{}, msg string, v ...interface{})
- func LPanicWithStruct(name string, obj interface{}, msg string, v ...interface{})
- func LWarn(name string, msg string, v ...interface{})
- func LWarnWithField(name string, msg string, v ...zap.Field)
- func LWarnWithMap(name string, obj map[string]interface{}, msg string, v ...interface{})
- func LWarnWithStruct(name string, obj interface{}, msg string, v ...interface{})
- func NormalTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func Painc(e error)
- func Warn(msg string, v ...interface{})
- func WarnWithField(msg string, v ...zap.Field)
- func WarnWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func WarnWithStruct(obj interface{}, msg string, v ...interface{})
- type LogObj
- type SpecLogger
- func (l SpecLogger) Debug(msg string, v ...interface{})
- func (l SpecLogger) DebugWithField(msg string, v ...zap.Field)
- func (l SpecLogger) DebugWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func (l SpecLogger) DebugWithStruct(obj interface{}, msg string, v ...interface{})
- func (l SpecLogger) Error(msg string, v ...interface{})
- func (l SpecLogger) ErrorWithField(msg string, v ...zap.Field)
- func (l SpecLogger) ErrorWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func (l SpecLogger) ErrorWithStruct(obj interface{}, msg string, v ...interface{})
- func (l SpecLogger) Info(msg string, v ...interface{})
- func (l SpecLogger) InfoWithField(msg string, v ...zap.Field)
- func (l SpecLogger) InfoWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func (l SpecLogger) InfoWithStruct(obj interface{}, msg string, v ...interface{})
- func (l SpecLogger) Panic(msg string, v ...interface{})
- func (l SpecLogger) PanicWithField(msg string, v ...zap.Field)
- func (l SpecLogger) PanicWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func (l SpecLogger) PanicWithStruct(obj interface{}, msg string, v ...interface{})
- func (l SpecLogger) Warn(msg string, v ...interface{})
- func (l SpecLogger) WarnWithField(msg string, v ...zap.Field)
- func (l SpecLogger) WarnWithMap(obj map[string]interface{}, msg string, v ...interface{})
- func (l SpecLogger) WarnWithStruct(obj interface{}, msg string, v ...interface{})
Constants ¶
View Source
const ( LevelDebug = -1 + iota LevelInfo LevelWarn LevelError LevelPanic )
View Source
const DefaultPath = "./logs"
View Source
const (
MillTimeFormat = "2006-01-02 15:04:05.000"
)
Variables ¶
This section is empty.
Functions ¶
func DebugWithField ¶
func DebugWithMap ¶
func DebugWithStruct ¶
func DebugWithStruct(obj interface{}, msg string, v ...interface{})
func ErrorWithField ¶
func ErrorWithMap ¶
func ErrorWithStruct ¶
func ErrorWithStruct(obj interface{}, msg string, v ...interface{})
func InfoWithField ¶
func InfoWithMap ¶
func InfoWithStruct ¶
func InfoWithStruct(obj interface{}, msg string, v ...interface{})
func InitLogger ¶
func LDebugWithMap ¶
func LDebugWithStruct ¶
func LErrorWithMap ¶
func LErrorWithStruct ¶
func LInfoWithMap ¶
func LInfoWithStruct ¶
func LPanicWithMap ¶
func LPanicWithStruct ¶
func LWarnWithMap ¶
func LWarnWithStruct ¶
func NormalTimeEncoder ¶
func NormalTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func WarnWithField ¶
func WarnWithMap ¶
func WarnWithStruct ¶
func WarnWithStruct(obj interface{}, msg string, v ...interface{})
Types ¶
type LogObj ¶
type LogObj struct { Key string Path string Name string Level int ShowCaller bool ToConsole bool ZapLogger *zap.Logger }
func CheckLogger ¶
type SpecLogger ¶
type SpecLogger struct {
Name string
}
var DBLogger *SpecLogger
DBLogger 数据库
var RequestLogger *SpecLogger
RequestLogger 所有输入与输出的日志 http,tcp,udp,serial...
var WSLogger *SpecLogger
WSLogger websocket
func NewSpecLogger ¶
func NewSpecLogger(name string, showCaller, toConsole bool) *SpecLogger
func (SpecLogger) Debug ¶
func (l SpecLogger) Debug(msg string, v ...interface{})
func (SpecLogger) DebugWithField ¶
func (l SpecLogger) DebugWithField(msg string, v ...zap.Field)
func (SpecLogger) DebugWithMap ¶
func (l SpecLogger) DebugWithMap(obj map[string]interface{}, msg string, v ...interface{})
func (SpecLogger) DebugWithStruct ¶
func (l SpecLogger) DebugWithStruct(obj interface{}, msg string, v ...interface{})
func (SpecLogger) Error ¶
func (l SpecLogger) Error(msg string, v ...interface{})
func (SpecLogger) ErrorWithField ¶
func (l SpecLogger) ErrorWithField(msg string, v ...zap.Field)
func (SpecLogger) ErrorWithMap ¶
func (l SpecLogger) ErrorWithMap(obj map[string]interface{}, msg string, v ...interface{})
func (SpecLogger) ErrorWithStruct ¶
func (l SpecLogger) ErrorWithStruct(obj interface{}, msg string, v ...interface{})
func (SpecLogger) Info ¶
func (l SpecLogger) Info(msg string, v ...interface{})
func (SpecLogger) InfoWithField ¶
func (l SpecLogger) InfoWithField(msg string, v ...zap.Field)
func (SpecLogger) InfoWithMap ¶
func (l SpecLogger) InfoWithMap(obj map[string]interface{}, msg string, v ...interface{})
func (SpecLogger) InfoWithStruct ¶
func (l SpecLogger) InfoWithStruct(obj interface{}, msg string, v ...interface{})
func (SpecLogger) Panic ¶
func (l SpecLogger) Panic(msg string, v ...interface{})
func (SpecLogger) PanicWithField ¶
func (l SpecLogger) PanicWithField(msg string, v ...zap.Field)
func (SpecLogger) PanicWithMap ¶
func (l SpecLogger) PanicWithMap(obj map[string]interface{}, msg string, v ...interface{})
func (SpecLogger) PanicWithStruct ¶
func (l SpecLogger) PanicWithStruct(obj interface{}, msg string, v ...interface{})
func (SpecLogger) Warn ¶
func (l SpecLogger) Warn(msg string, v ...interface{})
func (SpecLogger) WarnWithField ¶
func (l SpecLogger) WarnWithField(msg string, v ...zap.Field)
func (SpecLogger) WarnWithMap ¶
func (l SpecLogger) WarnWithMap(obj map[string]interface{}, msg string, v ...interface{})
func (SpecLogger) WarnWithStruct ¶
func (l SpecLogger) WarnWithStruct(obj interface{}, msg string, v ...interface{})
Click to show internal directories.
Click to hide internal directories.