log

package
v0.0.0-...-13a9703 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ldate         = log.Ldate
	Llongfile     = log.Llongfile
	Lmicroseconds = log.Lmicroseconds
	Lshortfile    = log.Lshortfile
	LstdFlags     = log.LstdFlags
	Ltime         = log.Ltime
)
View Source
const (
	TYPE_ERROR = LogType(1 << iota)
	TYPE_WARN
	TYPE_INFO
	TYPE_DEBUG
	TYPE_PANIC = LogType(^0)
)
View Source
const (
	LEVEL_NONE = LogLevel(1<<iota - 1)
	LEVEL_ERROR
	LEVEL_WARN
	LEVEL_INFO
	LEVEL_DEBUG
	LEVEL_ALL = LEVEL_DEBUG
)

Variables

View Source
var StdLog = New(NopCloser(os.Stderr), "")

Functions

func Debug

func Debug(v ...interface{})

func DebugError

func DebugError(err error, v ...interface{})

func DebugErrorf

func DebugErrorf(err error, format string, v ...interface{})

func Debugf

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

func Error

func Error(v ...interface{})

func ErrorError

func ErrorError(err error, v ...interface{})

func ErrorErrorf

func ErrorErrorf(err error, format string, v ...interface{})

func Errorf

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

func Flags

func Flags() int

func Info

func Info(v ...interface{})

func InfoError

func InfoError(err error, v ...interface{})

func InfoErrorf

func InfoErrorf(err error, format string, v ...interface{})

func Infof

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

func MustOpenFile

func MustOpenFile(path string) *os.File

func NopCloser

func NopCloser(w io.Writer) io.WriteCloser

func OpenFile

func OpenFile(path string) (*os.File, error)

func Panic

func Panic(v ...interface{})

func PanicError

func PanicError(err error, v ...interface{})

func PanicErrorf

func PanicErrorf(err error, format string, v ...interface{})

func Panicf

func Panicf(format string, v ...interface{})

func Prefix

func Prefix() string

func Print

func Print(v ...interface{})

func Printf

func Printf(format string, v ...interface{})

func Println

func Println(v ...interface{})

func PurePrintf

func PurePrintf(format string, v ...interface{})

func SetFlags

func SetFlags(flags int)

func SetLevel

func SetLevel(v LogLevel)

func SetPrefix

func SetPrefix(prefix string)

func SetTrace

func SetTrace(v LogLevel)

func Warn

func Warn(v ...interface{})

func WarnError

func WarnError(err error, v ...interface{})

func WarnErrorf

func WarnErrorf(err error, format string, v ...interface{})

func Warnf

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

Types

type LogLevel

type LogLevel int64

func (*LogLevel) Set

func (l *LogLevel) Set(v LogLevel)

func (*LogLevel) Test

func (l *LogLevel) Test(m LogType) bool

type LogType

type LogType int64

func (LogType) String

func (t LogType) String() string

type Logger

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

func FileLog

func FileLog(path string) (*Logger, error)

func MustFileLog

func MustFileLog(path string) *Logger

func New

func New(writer io.Writer, prefix string) *Logger

func (*Logger) Close

func (l *Logger) Close()

func (*Logger) Debug

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

func (*Logger) DebugError

func (l *Logger) DebugError(err error, v ...interface{})

func (*Logger) DebugErrorf

func (l *Logger) DebugErrorf(err error, format string, v ...interface{})

func (*Logger) Debugf

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

func (*Logger) Error

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

func (*Logger) ErrorError

func (l *Logger) ErrorError(err error, v ...interface{})

func (*Logger) ErrorErrorf

func (l *Logger) ErrorErrorf(err error, format string, v ...interface{})

func (*Logger) Errorf

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

func (*Logger) Flags

func (l *Logger) Flags() int

func (*Logger) Info

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

func (*Logger) InfoError

func (l *Logger) InfoError(err error, v ...interface{})

func (*Logger) InfoErrorf

func (l *Logger) InfoErrorf(err error, format string, v ...interface{})

func (*Logger) Infof

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

func (*Logger) Panic

func (l *Logger) Panic(v ...interface{})

func (*Logger) PanicError

func (l *Logger) PanicError(err error, v ...interface{})

func (*Logger) PanicErrorf

func (l *Logger) PanicErrorf(err error, format string, v ...interface{})

func (*Logger) Panicf

func (l *Logger) Panicf(format string, v ...interface{})

func (*Logger) Prefix

func (l *Logger) Prefix() string

func (*Logger) Print

func (l *Logger) Print(v ...interface{})

func (*Logger) Printf

func (l *Logger) Printf(format string, v ...interface{})

func (*Logger) Println

func (l *Logger) Println(v ...interface{})

func (*Logger) SetFlags

func (l *Logger) SetFlags(flags int)

func (*Logger) SetLevel

func (l *Logger) SetLevel(v LogLevel)

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(prefix string)

func (*Logger) SetTrace

func (l *Logger) SetTrace(v LogLevel)

func (*Logger) Warn

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

func (*Logger) WarnError

func (l *Logger) WarnError(err error, v ...interface{})

func (*Logger) WarnErrorf

func (l *Logger) WarnErrorf(err error, format string, v ...interface{})

func (*Logger) Warnf

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

Jump to

Keyboard shortcuts

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