Versions in this module Expand all Collapse all v1 v1.0.0 Aug 7, 2024 Changes in this version + func AppID() string + func AppVersion() string + func BuildHost() string + func BuildTime() string + func BuildUser() string + func Debug(a ...interface{}) + func DebugW(template string, a ...Field) + func Debugf(template string, a ...interface{}) + func Error(a ...interface{}) + func ErrorW(template string, a ...Field) + func Errorf(format string, a ...interface{}) + func Fatal(a ...interface{}) + func FatalW(template string, a ...Field) + func Fatalf(format string, a ...interface{}) + func FirstUpper(s string) string + func GoVersion() string + func HostName() string + func Info(a ...interface{}) + func InfoW(template string, a ...Field) + func Infof(template string, a ...interface{}) + func ModuleName() string + func PkgVersion() string + func Printf(format string, args ...interface{}) + func ServiceName() string + func SetAppID(s string) + func SetBuildTime(param string) + func SetLogger(logger Logger) + func SetModuleName(name string) + func SetServiceName(s string) + func StartTime() string + func Warn(a ...interface{}) + func WarnW(template string, a ...Field) + func Warnf(format string, a ...interface{}) + type Config struct + Addr string + Compress bool + Debug bool + Filename string + Level string + LocalTime bool + MaxAge time.Duration + MaxBackups int + MaxSize int64 + Net string + Tag string + func (c *Config) Build() + func (c *Config) BuildOption() []Option + func (c *Config) GetTag() string + func (c *Config) WithModuleName(moduleName string) *Config + func (c *Config) WithServiceName(serviceName string) *Config + type Field struct + Key string + Val FiledValue + func Any(key string, val interface{}) Field + func Bool(key string, val bool) Field + func Duration(key string, val time.Duration) Field + func FieldAddr(value string) Field + func FieldCost(value time.Duration) Field + func FieldErr(err error) Field + func FieldErrKind(value string) Field + func FieldEvent(value string) Field + func FieldKey(value string) Field + func FieldMessage(value string) Field + func FieldMethod(value string) Field + func FieldMod(value string) Field + func FieldName(value string) Field + func FieldStack(value []byte) Field + func FieldString(key, value string) Field + func FieldType(value string) Field + func Float64(key string, val float64) Field + func Int(key string, val int) Field + func Int32(key string, val int32) Field + func Int64(key string, val int64) Field + func String(key, val string) Field + func UInt(key string, val uint) Field + type FiledType int + const TypeAny + const TypeBool + const TypeFloat + const TypeInt + const TypeString + type FiledValue struct + T FiledType + V interface{} + type Helper struct + func NewHelper(logger Logger) *Helper + func (h *Helper) Debug(args ...interface{}) + func (h *Helper) DebugW(template string, args ...Field) + func (h *Helper) Debugf(template string, args ...interface{}) + func (h *Helper) Error(args ...interface{}) + func (h *Helper) ErrorW(template string, args ...Field) + func (h *Helper) Errorf(template string, args ...interface{}) + func (h *Helper) Fatal(args ...interface{}) + func (h *Helper) FatalW(template string, args ...Field) + func (h *Helper) Fatalf(template string, args ...interface{}) + func (h *Helper) Info(args ...interface{}) + func (h *Helper) InfoW(template string, args ...Field) + func (h *Helper) Infof(template string, args ...interface{}) + func (h *Helper) Trace(args ...interface{}) + func (h *Helper) Tracef(template string, args ...interface{}) + func (h *Helper) Warn(args ...interface{}) + func (h *Helper) WarnW(template string, args ...Field) + func (h *Helper) Warnf(template string, args ...interface{}) + type Level int8 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const TraceLevel + const WarnLevel + func GetLevel(levelStr string) (Level, error) + func (l Level) Enabled(lvl Level) bool + func (l Level) String() string + type Logger interface + Fields func(fields map[string]interface{}) Logger + Init func(options ...Option) error + Log func(level Level, keyvals ...interface{}) + LogW func(level Level, msg string, args ...Field) + Logf func(level Level, format string, keyvals ...interface{}) + OnChangeLevel func(level Level) + Options func() Options + Printf func(format string, args ...interface{}) + String func() string + var DefaultLogger Logger + func NewLogger(opts ...Option) Logger + type Option func(*Options) + func WithCallerSkipCount(c int) Option + func WithFields(fields map[string]interface{}) Option + func WithLevel(level Level) Option + func WithOutput(out io.Writer) Option + func WithSetOption(k, v interface{}) Option + func WithTag(tag string) Option + type Options struct + CallerSkipCount int + Context context.Context + Fields map[string]interface{} + Level Level + Out io.Writer + Tag string + type ZapCnf struct + Addr string + Compress bool + Debug bool + Filename string + Level string + LocalTime bool + MaxAge time.Duration + MaxBackups int + MaxSize int64 + Net string + Tag string + type ZapCnfKey struct