Documentation
¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func GetWriter() io.Writer
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitLogger(c Config)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Config
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(c Config)
Types ¶
type Config ¶
type Config struct {
Level string `json:"level" yaml:"level"` // 输出的日志级别, 默认debug
Target string `json:"target" yaml:"target"` // 日志标识,一般使用服务名,必须
ID string `json:"id" yaml:"id"` // 与target组成唯一标识
OutPath string `json:"outPath" yaml:"outPath"` // 日志文件输出路径,默认logs
MaxSize int `json:"maxSize" yaml:"maxSize"` // 文件最大大小 MB,默认50M
CallerSkip int `json:"callerSkip" yaml:"callerSkip"` // 跳过多少层次,找caller
}
func NewConfigByMap ¶
NewConfigByMap 从一个map中创建Config
Click to show internal directories.
Click to hide internal directories.