Documentation ¶
Index ¶
Constants ¶
View Source
const ( Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. 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 LstdFlags = Ldate | Ltime // initial values for the standard logger )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogLevelValue ¶
type LogLevelValue int
type LogRotator ¶
type LogRotator interface { IsEnabled() bool Hook(msgLen int64) rerrors.Error GetDefaultWriter() (io.Writer, bool) UpdateCallBack(callback RotationCallBack) }
func NewLogNoRotator ¶
func NewLogNoRotator(folder *os.File, fileName string, callback RotationCallBack) (LogRotator, error)
func NewLogRotator ¶
func NewLogRotator(folder *os.File, fileName string, maxFileSize int64, maxNoFiles int, callback RotationCallBack) (LogRotator, error)
Returns NEw LogRotator, in case dile size or number of rotations is less or equals to 0 no rotation will be prformed, and the file will increase size, continuously. Please take care to this topic
type Logger ¶
type Logger interface { Tracef(format string, in ...interface{}) Trace(in ...interface{}) Debugf(format string, in ...interface{}) Debug(in ...interface{}) Infof(format string, in ...interface{}) Info(in ...interface{}) Warnf(format string, in ...interface{}) Warn(in ...interface{}) Errorf(format string, in ...interface{}) Error(in ...interface{}) Fatalf(format string, in ...interface{}) Fatal(in ...interface{}) Printf(format string, in ...interface{}) Println(in ...interface{}) SetVerbosity(verbosity LogLevel) GetVerbosity() LogLevel Successf(format string, in ...interface{}) Success(in ...interface{}) Failuref(format string, in ...interface{}) Failure(in ...interface{}) IsAffiliated() bool AffiliateTo(l Logger) AffiliateLog(affiliateAppName string, level LogLevelValue, in ...interface{}) AffiliateLogf(affiliateAppName string, level LogLevelValue, format string, in ...interface{}) AffiliateWrite(affiliateAppName string, buff []byte) AddEchoWriter(key string, writer io.Writer) RemoveEchoWriter(key string) }
func NewFileLogger ¶
func NewFileLogger(appName string, logRotator LogRotator, verbosity LogLevel) (Logger, error)
type RotationCallBack ¶
type RotationCallBack func()
Click to show internal directories.
Click to hide internal directories.