log

package
v0.0.0-...-bbd8ef1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 10 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(fmt string, v ...interface{})

func Debug

func Debug(fmt string, v ...interface{})

func Error

func Error(fmt string, v ...interface{})

func Gen

func Gen(servername, filename string)

func Info

func Info(fmt string, v ...interface{})

func InitLog

func InitLog(servername, dirname, filename, logFormat string)

user-defined output

func Notice

func Notice(fmt string, v ...interface{})

func SetLogger

func SetLogger(lg Logger)

func Warning

func Warning(fmt string, v ...interface{})

Types

type FileLogWriter

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

func NewFileLogWriter

func NewFileLogWriter(filename string, rotate bool, maxsize int64) (*FileLogWriter, error)

func (*FileLogWriter) Close

func (w *FileLogWriter) Close()

func (*FileLogWriter) Rotate

func (w *FileLogWriter) Rotate() error

If this is called in a threaded context, it MUST be synchronized

func (*FileLogWriter) SetRotateHourly

func (w *FileLogWriter) SetRotateHourly(hourly bool) *FileLogWriter

func (*FileLogWriter) SetRotateSize

func (w *FileLogWriter) SetRotateSize(maxsize int64) *FileLogWriter

func (*FileLogWriter) Write

func (w *FileLogWriter) Write(p []byte) (int, error)

type Logger

type Logger interface {
	Debugf(fmt string, v ...interface{})
	Infof(fmt string, v ...interface{})
	Warningf(fmt string, v ...interface{})
	Errorf(fmt string, v ...interface{})
	Noticef(fmt string, v ...interface{})
	Criticalf(fmt string, v ...interface{})
}

func GetLogger

func GetLogger() Logger

Jump to

Keyboard shortcuts

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