Documentation
¶
Index ¶
- Variables
- func CopyFile(srcFile, destFile string) error
- func Debug(msg string)
- func DebugOrWarnf(start time.Time, format string, args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(msg string, err error)
- func Errorf(err error, format string, args ...interface{})
- func EscapPath(msg string) string
- func Fatal(msg string, err error)
- func Fatalf(err error, format string, args ...interface{})
- func FilterFileList(path, pat string, permits os.FileMode) ([]string, error)
- func Info(msg string)
- func InfoOrWarnf(start time.Time, format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func NilOrWarnf(start time.Time, format string, args ...interface{})
- func Panic(r interface{})
- func Recover()
- func Rotate(path string, MaxFileSize int, MaxBackupCount int)
- func RotateFile(file string, MaxFileSize int, MaxBackupCount int)
- func SetGlobal(cfg Config)
- func Sync()
- func Warn(msg string)
- func Warnf(format string, args ...interface{})
- type Config
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(msg string, err error)
- func (l *Logger) Errorf(err error, format string, args ...interface{})
- func (l *Logger) Fatal(msg string, err error)
- func (l *Logger) Fatalf(err error, format string, args ...interface{})
- func (l *Logger) Info(msg string)
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Recover(r interface{}, callerSkip int)
- func (l *Logger) Sync()
- func (l *Logger) Warn(msg string)
- func (l *Logger) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DebugOrWarnf ¶
func FilterFileList ¶
path : where the file will be filtered pat : regexp pattern to filter the matched file permit : check the file whether match any of the permits or not
func InfoOrWarnf ¶
func NilOrWarnf ¶
func Recover ¶
func Recover()
Recover is a function call recover() and print the stack in log Please call this function like 'defer log.Recover()' in your code
func Rotate ¶
path: where log files need rollover MaxFileSize: MaxSize of a file before rotate. By M Bytes. MaxBackupCount: Max counts to keep of a log's backup files.
func RotateFile ¶
Types ¶
type Config ¶
type Config struct { LoggerLevel string LoggerFile string // if false, log print with JSON format LogFormatText bool // M Bytes LogRotateSize int LogBackupCount int // days LogBackupAge int CallerSkip int NoTime bool // if true, not record time NoLevel bool // if true, not record level NoCaller bool // if true, not record caller }
Config struct for lager and rotate parameters
func (Config) WithCallerSkip ¶
func (Config) WithNoCaller ¶
func (Config) WithNoLevel ¶
func (Config) WithNoTime ¶
Click to show internal directories.
Click to hide internal directories.