xlog

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: GPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	D_LOG_FLAGS int = log.LstdFlags | log.Lmicroseconds
)

Variables

View Source
var (
	DefaultName  = " "
	DefaultLevel = DEBUG
)
View Source
var LevelNames = [...]string{
	DEBUG:   "DEBUG",
	INFO:    "INFO",
	WARNING: "WARNING",
	ERROR:   "ERROR",
	FATAL:   "FATAL",
	PANIC:   "PANIC",
}

Functions

This section is empty.

Types

type Log

type Log struct {
	*log.Logger
	// contains filtered or unexported fields
}

func GetLog

func GetLog() *Log

func NewLog

func NewLog(w io.Writer, prefix string, flag int) *Log

func NewStdLog

func NewStdLog(opts ...Option) *Log

func NewSysLog

func NewSysLog(opts ...Option) *Log

syslog

func NewXLog

func NewXLog(w io.Writer, opts ...Option) *Log

func (*Log) Close

func (t *Log) Close()

func (*Log) Debug

func (t *Log) Debug(format string, v ...interface{})

func (*Log) Error

func (t *Log) Error(format string, v ...interface{})

func (*Log) Fatal

func (t *Log) Fatal(format string, v ...interface{})

func (*Log) Info

func (t *Log) Info(format string, v ...interface{})

func (*Log) Panic

func (t *Log) Panic(format string, v ...interface{})

func (*Log) SetLevel

func (t *Log) SetLevel(level string)

func (*Log) Warning

func (t *Log) Warning(format string, v ...interface{})

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = 1 << iota
	INFO
	WARNING
	ERROR
	FATAL
	PANIC
)

type Option

type Option func(*Options)

func Level

func Level(v LogLevel) Option

Log Level

func Name

func Name(v string) Option

Log Name

type Options

type Options struct {
	Name  string
	Level LogLevel
}

Jump to

Keyboard shortcuts

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