log

package
v1.1.7-beta Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: Apache-2.0 Imports: 14 Imported by: 40

Documentation

Index

Constants

View Source
const (
	Red     = "0;31"
	Green   = "0;32"
	Yellow  = "0;33"
	Magenta = "0;35"
	Cyan    = "0;36"
)
View Source
const (
	LogFileExt = ".log"
)

Variables

View Source
var (
	Stdout = os.Stdout
)

Functions

func Color

func Color(code, msg string) string

func Debug

func Debug(a ...interface{})

func Debugf

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

func Error

func Error(a ...interface{})

func Errorf

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

func Fatal

func Fatal(a ...interface{})

func Fatalf

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

func GetGID

func GetGID() uint64

func Info

func Info(a ...interface{})

func Infof

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

func Init

func Init() error

func LevelName

func LevelName(level int) string

func NameLevel

func NameLevel(name string) int

func OpenLogFile

func OpenLogFile(path string, name string) (*os.File, error)

func PruneLogFiles

func PruneLogFiles(logPath string) error

func Warning

func Warning(a ...interface{})

func Warningf

func Warningf(format string, a ...interface{})

Types

type Logger

type Logger struct {
	sync.RWMutex
	// contains filtered or unexported fields
}
var Log *Logger
var WebLog *Logger

func (*Logger) Debug

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

func (*Logger) Debugf

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

func (*Logger) Error

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

func (*Logger) Errorf

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

func (*Logger) Fatal

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

func (*Logger) Fatalf

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

func (*Logger) GetLevel

func (l *Logger) GetLevel() int

func (*Logger) GetLogFileSize

func (l *Logger) GetLogFileSize() (int64, error)

func (*Logger) Info

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

func (*Logger) Infof

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

func (*Logger) Output

func (l *Logger) Output(level int, a ...interface{}) error

func (*Logger) Outputf

func (l *Logger) Outputf(level int, format string, v ...interface{}) error

func (*Logger) SetDebugLevel

func (l *Logger) SetDebugLevel(level int) error

func (*Logger) Warning

func (l *Logger) Warning(a ...interface{})

func (*Logger) Warningf

func (l *Logger) Warningf(format string, a ...interface{})

Jump to

Keyboard shortcuts

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