xlog

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

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