log

package
v0.0.0-...-d6a9545 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Bits or'ed together to control what's printed.
	// There is no control over the order they appear (the order listed
	// here) or the format they present (as described in the comments).
	// The prefix is followed by a colon only when Llongfile or Lshortfile
	// is specified.
	// For example, flags Ldate | Ltime (or LstdFlags) produce,
	//	2009/01/23 01:23:23 message
	// while flags Ldate | Ltime | Lmicroseconds | Llongfile produce,
	//	2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
	Ldate      = 1 << iota     // the date in the local time zone: 2009/01/23
	Ltime                      // the time in the local time zone: 01:23:23
	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
	Llevel                     //
	LUTC                       // if Ldate or Ltime is set, use UTC rather than the local time zone
	LstdFlags  = Ldate | Ltime // initial values for the standard logger
)
View Source
const (
	LogFatal uint32 = iota
	LogError
	LogWarning
	LogInfo
	LogDebug
)
View Source
const (
	LogFatalS   = "fatal"
	LogErrorS   = "error"
	LogWarningS = "warning"
	LogInfoS    = "info"
	LogDebugS   = "debug"
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func LogLevel2String

func LogLevel2String(level uint32) string

func Profile

func Profile(format string, args ...interface{})

func ProfileSetFlags

func ProfileSetFlags(flags uint32)

func RestLogger

func RestLogger(logger *Logger, levels ...uint32)

func RestProfileLogger

func RestProfileLogger(logger *Logger)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

Types

type Cleaner

type Cleaner struct {
	// contains filtered or unexported fields
}

func NewCleaner

func NewCleaner(expire string, files ...string) *Cleaner

func (*Cleaner) Start

func (c *Cleaner) Start()

func (*Cleaner) Stop

func (c *Cleaner) Stop()

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger(level uint32) *Logger

func NewLogger

func NewLogger(file string) *Logger

func ProfileGetLogger

func ProfileGetLogger() *Logger

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Debug

func (l *Logger) Debug(args ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(args ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(args ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

func (*Logger) Flush

func (l *Logger) Flush() error

func (*Logger) GetLevel

func (l *Logger) GetLevel() uint32

func (*Logger) Info

func (l *Logger) Info(args ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) Open

func (l *Logger) Open() (*Logger, error)

func (*Logger) Output

func (l *Logger) Output(calldepth int, level uint32, s string) error

Low level write handler. Usually you should not use this API.

func (*Logger) SetFlags

func (l *Logger) SetFlags(flags uint32)

func (*Logger) SetLogLevel

func (l *Logger) SetLogLevel(level uint32)

Set Logger output level.

func (*Logger) SetRolling

func (l *Logger) SetRolling(t RollingType)

func (*Logger) Warn

func (l *Logger) Warn(args ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

type RollingType

type RollingType uint32
const (
	RollingDeny RollingType = iota
	RollingByHour
	RollingByDay
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL