Documentation
¶
Index ¶
- Constants
- func CallDepth() int
- 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 Flags() int
- 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 SetFileFormat(s StorageType, format string)
- func SetFlags(flag int)
- func SetLevel(level int)
- func SetOutput(w Writer, prefix string)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type FileInfo
- type FileWriter
- type FileWriterOptions
- type LogData
- type Logger
- func (l *Logger) CallDepth() int
- func (l *Logger) Debug(format string, v ...interface{})
- func (l *Logger) Error(format string, v ...interface{})
- func (l *Logger) Fatal(format string, v ...interface{})
- func (l *Logger) Flags() int
- func (l *Logger) Info(format string, v ...interface{})
- func (l *Logger) Notice(format string, v ...interface{})
- func (l *Logger) Panic(format string, v ...interface{})
- func (l *Logger) Prefix() string
- func (l *Logger) SetCallDepth(depth int)
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetLevel(level int)
- func (l *Logger) SetOutput(w Writer, prefix string)
- func (l *Logger) SetPrefix(prefix string)
- func (l *Logger) Warn(format string, v ...interface{})
- type StorageType
- type Writer
Constants ¶
View Source
const ( Ldate = 1 << iota // the date in the local time zone: 2006-01-02 Ltime // the time in the local time zone: 15:04:05 Lmicroseconds // microsecond resolution: 01:23:23.123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone Lmodule // module name Llevel // the level of the logy LstdFlags = Ldate | Lmicroseconds | Lshortfile | Llevel // initial values for the standard logger )
View Source
const ( LevelDebug LevelInfo LevelNotice LevelWarn LevelError LevelPanic LevelFatal )
Variables ¶
This section is empty.
Functions ¶
func SetCallDepth ¶
func SetCallDepth(depth int)
Types ¶
type FileWriter ¶
type FileWriter struct { FileWriterOptions sync.Mutex // contains filtered or unexported fields }
FileWriter 文件存储实现
func NewFileWriter ¶
func NewFileWriter(opts ...FileWriterOptions) *FileWriter
NewFileWriter return a new FileWriter
struct FileWriterOptions
type FileWriterOptions ¶
type FileWriterOptions struct { StorageType StorageType //存储类型 StorageMaxDay int //最大保存天数 Dir string //目录 Prefix string //前缀 // contains filtered or unexported fields }
FileWriterOptions FileWriterOptions
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) SetCallDepth ¶
type StorageType ¶
type StorageType int
StorageType 文件存储类型
const ( // StorageTypeMinutes 按分钟存储 StorageTypeMinutes StorageType = iota // StorageTypeHour 按小时存储 StorageTypeHour // StorageTypeDay 按天存储 StorageTypeDay // StorageTypeMonth 按月份存储 StorageTypeMonth )
type Writer ¶
Writer writer interface
func NewMutexWriter ¶
NewMutexWriter returns a currently safe writer.
Click to show internal directories.
Click to hide internal directories.