logs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2017 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	WARN
	ERROR
	FATAL
	OFF
)

Log levels to control the logging output.

Variables

This section is empty.

Functions

func ExchangeLevel added in v1.0.0

func ExchangeLevel(l int) int

Types

type Logger

type Logger interface {
	SetMsgChan(channelLen int64)
	// SetLevel Set log message level.
	// If message level (such as LevelDebug) is higher than logger level (such as LevelWarning),
	// log providers will not even be sent the message.
	SetLevel(l int)
	// EnableFuncCallDepth enable log funcCallDepth
	EnableFuncCallDepth(b bool)
	// AddAdapter provides a given logger adapter into Logger with config string.
	// config need to be correct JSON as string: {"interval":360}.
	AddAdapter(adaptername string, config string) error

	Write(p []byte) (n int, err error)
	Sys(format string, v ...interface{})
	Fatal(format string, v ...interface{})
	Error(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Info(format string, v ...interface{})
	Debug(format string, v ...interface{})
}

func NewLogger

func NewLogger(channelLen int64) Logger

type TgLogger

type TgLogger struct {
	*logs.BeeLogger
}

func (*TgLogger) SetLevel

func (t *TgLogger) SetLevel(l int)

Directories

Path Synopsis
Package logs provide a general log interface Usage: import "github.com/astaxie/beego/logs" log := NewLogger(10000) log.AddAdapter("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") more docs http://beego.me/docs/module/logs.md
Package logs provide a general log interface Usage: import "github.com/astaxie/beego/logs" log := NewLogger(10000) log.AddAdapter("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") more docs http://beego.me/docs/module/logs.md
es

Jump to

Keyboard shortcuts

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