Documentation
¶
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func GetWriterType() string
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func SetCallDepth(depth int)
- func SetFlags(flag int)
- func SetOutput(w Writer, prefix string)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type FileInfo
- type FileWriter
- type FileWriterOptions
- type Logger
- func (log *Logger) Debug(format string, v ...interface{})
- func (log *Logger) Error(format string, v ...interface{})
- func (log *Logger) Fatal(format string, v ...interface{})
- func (log *Logger) GetCallDepth() int
- func (log *Logger) GetWriterType() string
- func (log *Logger) Info(format string, v ...interface{})
- func (log *Logger) Notice(format string, v ...interface{})
- func (log *Logger) Panic(format string, v ...interface{})
- func (log *Logger) SetCallDepth(depth int)
- func (log *Logger) SetFlags(flag int)
- func (log *Logger) SetOutput(w Writer, prefix string)
- func (log *Logger) SetPrefix(prefix string)
- func (log *Logger) Warn(format string, v ...interface{})
- type StorageType
- type Writer
Constants ¶
View Source
const ( LogDate = 1 << iota LogTime LogMicroSeconds LogLongFile LogShortFile LogUTC LogModule LogLevel StdFlags = LogDate | LogMicroSeconds | LogShortFile | LogLevel )
View Source
const ( LevelTest = iota LevelDebug LevelInfo LevelNotice LevelWarn LevelError LevelPanic LevelFatal )
Variables ¶
This section is empty.
Functions ¶
func GetWriterType ¶ added in v1.0.5
func GetWriterType() string
func Infof ¶
func Infof(format string, v ...interface{})
Infof need format
logy.Infof("user :%s",user.Username)
func SetCallDepth ¶
func SetCallDepth(depth int)
Types ¶
type FileWriter ¶
type FileWriter struct { FileWriterOptions // contains filtered or unexported fields }
FileWriter 日志文件存储实现
func NewFileWriter ¶
func NewFileWriter(opts ...FileWriterOptions) *FileWriter
NewFileWriter return a new FileWriter
param: opts
type FileWriterOptions ¶
type FileWriterOptions struct { // StorageType 存储时间类型 StorageType StorageType // StorageMaxDay 日志最大保存天数 StorageMaxDay int // Dir 保存目录 Dir string // Prefix 前缀 Prefix string // contains filtered or unexported fields }
FileWriterOptions FileWrite 参数
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger log struct
func (*Logger) GetCallDepth ¶ added in v1.0.5
func (*Logger) GetWriterType ¶ added in v1.0.5
GetWriterType return writer type
func (*Logger) SetCallDepth ¶
type StorageType ¶
type StorageType int
const ( // StorageTypeMinutes 按分钟存储 StorageTypeMinutes StorageType = iota // StorageTypeHour 按小时存储 StorageTypeHour // StorageTypeDay 按天存储 StorageTypeDay // StorageTypeMonth 按月存储 StorageTypeMonth )
Click to show internal directories.
Click to hide internal directories.