logger

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HomeDirFlag 当前用户家目录标识符
	HomeDirFlag = "~"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BeeLogger

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

BeeLogger beego log实现

func NewBeeLogger

func NewBeeLogger(conf *config.Config) *BeeLogger

NewBeeLogger 创建BeeLogger实例

func (*BeeLogger) Debug

func (log *BeeLogger) Debug(v ...interface{})

Debug logs a debug message. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) Debugf

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

Debug logs a debug message with format. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) Error

func (log *BeeLogger) Error(v ...interface{})

Error logs an error message. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) Errorf

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

Error logs an error message with format. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) Info

func (log *BeeLogger) Info(v ...interface{})

Info logs a info message. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) Infof

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

Info logs a info message with format. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) SetField

func (log *BeeLogger) SetField(name string, value interface{})

func (*BeeLogger) Warn

func (log *BeeLogger) Warn(v ...interface{})

Warn logs a warning message. If last parameter is a map[string]string, it's content is added as fields to the message.

func (*BeeLogger) Warnf

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

Warn logs a warning message with format. If last parameter is a map[string]string, it's content is added as fields to the message.

type Logger

type Logger interface {
	// SetField sets a field on the logger's context. All future messages on this logger
	// will have this field set.
	SetField(name string, value interface{})
	// Debug logs a debug message. If last parameter is a map[string]string, it's content
	// is added as fields to the message.
	Debug(v ...interface{})
	// Debug logs a debug message with format. If last parameter is a map[string]string,
	// it's content is added as fields to the message.
	Debugf(format string, v ...interface{})
	// Info logs a info message. If last parameter is a map[string]string, it's content
	// is added as fields to the message.
	Info(v ...interface{})
	// Info logs a info message with format. If last parameter is a map[string]string,
	// it's content is added as fields to the message.
	Infof(format string, v ...interface{})
	// Warn logs a warning message. If last parameter is a map[string]string, it's content
	// is added as fields to the message.
	Warn(v ...interface{})
	// Warn logs a warning message with format. If last parameter is a map[string]string,
	// it's content is added as fields to the message.
	Warnf(format string, v ...interface{})
	// Error logs an error message. If last parameter is a map[string]string, it's content
	// is added as fields to the message.
	Error(v ...interface{})
	// Error logs an error message with format. If last parameter is a map[string]string,
	// it's content is added as fields to the message.
	Errorf(format string, v ...interface{})
}

Logger 系统logger接口

type LogrusLogger

type LogrusLogger struct {
	*logrus.Entry
}

func NewLogger

func NewLogger() *LogrusLogger

func NewLogrusLogger

func NewLogrusLogger(conf *config.Config) (logrusLogger *LogrusLogger)

func (*LogrusLogger) SetField

func (log *LogrusLogger) SetField(key string, value interface{})

Jump to

Keyboard shortcuts

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