log

package
v0.0.0-...-9fb4324 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MIT Imports: 0 Imported by: 0

README

log

support logrus

usage

  • use without interface log

govendor fetch github.com/s3dteam/go-toolkit/log/logruslogger

  • use with interface log

govendor fetch github.com/s3dteam/go-toolkit/log/^

example

    type temps struct {
		log log.Logger
	}
	options := &logruslogger.Options{}
	options.WithCallerHook = true
	options.Depth = 8

	a := &temps{
		log: logruslogger.GetLoggerWithOptions("a-logrus", options),
	}

	a.log.Debug("")
	a.log.Debug(time.Now())
	a.log.Debug(123, time.Now())
	a.log.Debug("test %v", time.Now().UnixNano())
	a.log.Warn("test %v", time.Now().UnixNano())
	a.log.Info("test %v", time.Now().UnixNano())
	a.log.Printf("test %v", time.Now().UnixNano())
	a.log.Printf("test", time.Now().UnixNano())
	a.log.Error("test %v", time.Now().UnixNano())

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debug(f interface{}, args ...interface{})
	Info(f interface{}, args ...interface{})
	Warn(f interface{}, args ...interface{})
	Printf(f interface{}, args ...interface{})
	Panic(f interface{}, args ...interface{})
	Fatal(f interface{}, args ...interface{})
	Error(f interface{}, args ...interface{})

	Debugln(v ...interface{})
	Infoln(args ...interface{})
	Warnln(args ...interface{})
	Printfln(args ...interface{})
	Panicln(args ...interface{})
	Fatalln(args ...interface{})
	Errorln(args ...interface{})
}

Logger log interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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