logging

package module
v0.0.0-...-165886d Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 9 Imported by: 0

README

logging

这是一个只需要引入就能全局使用的日志库.

使用方法

todo

内嵌日志库

todo

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
	Ldebug
	Linfo
	Lwarn
	Lerror
	Lpanic
	Ltrace
	LstdFlags = Ldate | Ltime | Llongfile // initial values for the standard logger

)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Debugln

func Debugln(args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

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

func Errorln

func Errorln(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

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

func Fatalln

func Fatalln(args ...interface{})

func Info

func Info(args ...interface{})

func Infof

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

func Infoln

func Infoln(args ...interface{})

func SetAPIBOXLogging

func SetAPIBOXLogging(l *logging.Logger)

func SetDefault

func SetDefault(l Logging)

func SetOpLogging

func SetOpLogging(l *logging.Logger)

func Warning

func Warning(args ...interface{})

func Warningf

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

func Warningln

func Warningln(args ...interface{})

Types

type FastLogger

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

func New

func New(out io.Writer, prefix string, flag int) *FastLogger

func NewStdFastLog

func NewStdFastLog() *FastLogger

func (*FastLogger) Debug

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

Debug calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Debugf

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

Debugf calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Debugln

func (l *FastLogger) Debugln(v ...interface{})

Debugln calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Error

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

Error calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Errorf

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

Errorf calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Errorln

func (l *FastLogger) Errorln(v ...interface{})

Errorln calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Fatal

func (l *FastLogger) Fatal(v ...interface{})

Fatal is equivalent to l.Print() followed by a call to os.Exit(1).

func (*FastLogger) Fatalf

func (l *FastLogger) Fatalf(format string, v ...interface{})

Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).

func (*FastLogger) Fatalln

func (l *FastLogger) Fatalln(v ...interface{})

Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).

func (*FastLogger) Flags

func (l *FastLogger) Flags() int

Flags returns the output flags for the logger.

func (*FastLogger) Info

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

Info calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Infof

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

Infof calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Infoln

func (l *FastLogger) Infoln(v ...interface{})

Infoln calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Output

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

func (*FastLogger) Panic

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

Panic is equivalent to l.Print() followed by a call to panic().

func (*FastLogger) Panicf

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

Panicf is equivalent to l.Printf() followed by a call to panic().

func (*FastLogger) Panicln

func (l *FastLogger) Panicln(v ...interface{})

Panicln is equivalent to l.Println() followed by a call to panic().

func (*FastLogger) Prefix

func (l *FastLogger) Prefix() string

Prefix returns the output prefix for the logger.

func (*FastLogger) Print

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

Print calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Print.

func (*FastLogger) Printf

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

Printf calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Println

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

Println calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Println.

func (*FastLogger) SetFlags

func (l *FastLogger) SetFlags(flag int)

SetFlags sets the output flags for the logger.

func (*FastLogger) SetPrefix

func (l *FastLogger) SetPrefix(prefix string)

SetPrefix sets the output prefix for the logger.

func (*FastLogger) StdLog

func (l *FastLogger) StdLog() *log.Logger

func (*FastLogger) Trace

func (l *FastLogger) Trace(v ...interface{})

Trace calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Tracef

func (l *FastLogger) Tracef(format string, v ...interface{})

Tracef calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Traceln

func (l *FastLogger) Traceln(v ...interface{})

Traceln calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Warning

func (l *FastLogger) Warning(v ...interface{})

Warn calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Warningf

func (l *FastLogger) Warningf(format string, v ...interface{})

Warnf calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*FastLogger) Warningln

func (l *FastLogger) Warningln(v ...interface{})

Warnln calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

type LoggerAPIBOX

type LoggerAPIBOX struct {
	*logging.Logger
}

func (*LoggerAPIBOX) Debugln

func (lop *LoggerAPIBOX) Debugln(v ...interface{})

func (*LoggerAPIBOX) Errorln

func (lop *LoggerAPIBOX) Errorln(v ...interface{})

func (*LoggerAPIBOX) Fatalln

func (lop *LoggerAPIBOX) Fatalln(v ...interface{})

func (*LoggerAPIBOX) Infoln

func (lop *LoggerAPIBOX) Infoln(v ...interface{})

func (*LoggerAPIBOX) Warningln

func (lop *LoggerAPIBOX) Warningln(v ...interface{})

type LoggerOP

type LoggerOP struct {
	*logging.Logger
}

func (*LoggerOP) Debugln

func (lop *LoggerOP) Debugln(v ...interface{})

func (*LoggerOP) Errorln

func (lop *LoggerOP) Errorln(v ...interface{})

func (*LoggerOP) Fatalln

func (lop *LoggerOP) Fatalln(v ...interface{})

func (*LoggerOP) Infoln

func (lop *LoggerOP) Infoln(v ...interface{})

func (*LoggerOP) Print

func (lop *LoggerOP) Print(v ...interface{})

func (*LoggerOP) Printf

func (lop *LoggerOP) Printf(f string, v ...interface{})

func (*LoggerOP) Println

func (lop *LoggerOP) Println(v ...interface{})

func (*LoggerOP) Warningln

func (lop *LoggerOP) Warningln(v ...interface{})

type Logging

type Logging interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Debugln(args ...interface{})

	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Infoln(args ...interface{})

	Warning(args ...interface{})
	Warningf(format string, args ...interface{})
	Warningln(args ...interface{})

	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Errorln(args ...interface{})

	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Fatalln(args ...interface{})
}

Jump to

Keyboard shortcuts

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