Documentation ¶
Index ¶
- Constants
- Variables
- func GetGID() uint64
- type EasyLogger
- func (this *EasyLogger) Debug(a ...interface{})
- func (this *EasyLogger) Debugf(format string, a ...interface{})
- func (this *EasyLogger) Error(a ...interface{})
- func (this *EasyLogger) Errorf(format string, a ...interface{})
- func (this *EasyLogger) Fatal(a ...interface{})
- func (this *EasyLogger) Fatalf(format string, a ...interface{})
- func (this *EasyLogger) Info(a ...interface{})
- func (this *EasyLogger) Infof(format string, a ...interface{})
- func (this *EasyLogger) Trace(a ...interface{})
- func (this *EasyLogger) Tracef(format string, a ...interface{})
- func (this *EasyLogger) Warn(a ...interface{})
- func (this *EasyLogger) Warnf(format string, a ...interface{})
- type Logger
Constants ¶
View Source
const ( CALL_DEPTH = 2 TRACE = "[TRACE]" DEBUG = "[DEBUG]" INFO = "[INFO ]" WARN = "[WARN ]" ERROR = "[ERROR]" FATAL = "[FATAL]" )
View Source
const ( DefaultLogDir = "./Logs/" FileNameTimeFormat = "2006-01-02" FileNameExt = ".log" CompressSuffix = ".gz" NanosecondPerDay = 24 * 3600 * time.Second )
Variables ¶
Functions ¶
Types ¶
type EasyLogger ¶
type EasyLogger struct {
// contains filtered or unexported fields
}
EasyLogger uses log.Logger inside
func NewSizeRotatingEasyLogger ¶ added in v1.1.0
func NewTimeRotatingEasyLogger ¶ added in v1.1.0
func (*EasyLogger) Debug ¶
func (this *EasyLogger) Debug(a ...interface{})
func (*EasyLogger) Debugf ¶
func (this *EasyLogger) Debugf(format string, a ...interface{})
func (*EasyLogger) Error ¶
func (this *EasyLogger) Error(a ...interface{})
func (*EasyLogger) Errorf ¶
func (this *EasyLogger) Errorf(format string, a ...interface{})
func (*EasyLogger) Fatal ¶
func (this *EasyLogger) Fatal(a ...interface{})
func (*EasyLogger) Fatalf ¶
func (this *EasyLogger) Fatalf(format string, a ...interface{})
func (*EasyLogger) Info ¶
func (this *EasyLogger) Info(a ...interface{})
func (*EasyLogger) Infof ¶
func (this *EasyLogger) Infof(format string, a ...interface{})
func (*EasyLogger) Trace ¶
func (this *EasyLogger) Trace(a ...interface{})
func (*EasyLogger) Tracef ¶
func (this *EasyLogger) Tracef(format string, a ...interface{})
func (*EasyLogger) Warn ¶
func (this *EasyLogger) Warn(a ...interface{})
func (*EasyLogger) Warnf ¶
func (this *EasyLogger) Warnf(format string, a ...interface{})
type Logger ¶ added in v1.1.0
type Logger struct { // Directory is the place to store log files. // Default is "./Logs/" Directory string // MaxDays is the maximum number of days to rotate. // The default is not rotating. MaxDays int // MaxBackups is the maximum number of files to retain. // The default is to retain all old files. MaxBackups int // LocalTime determines if the time used for formatting the timestamps in // backup files is the computer's local time. The default is to use UTC // time. LocalTime bool // Compress determines if the rotated log files should be compressed // using gzip. The default is not to perform compression. Compress bool // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.