log

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const GoTime = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func GetOutFile

func GetOutFile() (out io.Writer)

func Info

func Info(args ...interface{})

func Infof

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

func Init

func Init() func()

func Print

func Print(args ...interface{})

func Printf

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

func Println

func Println(args ...interface{})

func Warn

func Warn(args ...interface{})

func Warnf

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

Types

type GiNanaStdFormatter

type GiNanaStdFormatter struct {
	// TimestampFormat sets the format used for marshaling timestamps.
	TimestampFormat string

	// DisableTimestamp allows disabling automatic timestamps in output
	DisableTimestamp bool
	DisableColors    bool
}

GiNanaStdFormatter 自定义 formatter

func (*GiNanaStdFormatter) Format

func (f *GiNanaStdFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format implement the Formatter interface

func (*GiNanaStdFormatter) LevelColor

func (f *GiNanaStdFormatter) LevelColor(level interface{}) string

func (*GiNanaStdFormatter) NameColor

func (f *GiNanaStdFormatter) NameColor() string

func (*GiNanaStdFormatter) ResetColor

func (f *GiNanaStdFormatter) ResetColor() string

type Logger

type Logger interface {
	GetOutFile() (out io.Writer)

	Print(args ...interface{})
	Println(args ...interface{})
	Error(args ...interface{})
	Warn(args ...interface{})
	Info(args ...interface{})
	Debug(args ...interface{})
	Printf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	// contains filtered or unexported methods
}

func GetLogger

func GetLogger() Logger

type Loggers

type Loggers []Logger

func (Loggers) Debug

func (h Loggers) Debug(args ...interface{})

func (Loggers) Debugf

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

func (Loggers) Error

func (h Loggers) Error(args ...interface{})

func (Loggers) Errorf

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

func (Loggers) GetOutFile

func (h Loggers) GetOutFile() (out io.Writer)

func (Loggers) Info

func (h Loggers) Info(args ...interface{})

func (Loggers) Infof

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

func (Loggers) Print

func (h Loggers) Print(args ...interface{})

func (Loggers) Printf

func (h Loggers) Printf(format string, args ...interface{})

func (Loggers) Println

func (h Loggers) Println(args ...interface{})

func (Loggers) Warn

func (h Loggers) Warn(args ...interface{})

func (Loggers) Warnf

func (h Loggers) Warnf(format string, args ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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