gxlog

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 7 Imported by: 1

README

gxlog

Documentation

Index

Constants

View Source
const (
	DefaultLevel      = LevelTrace
	DefaultTrackLevel = LevelFatal
	DefaultExitLevel  = LevelOff
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auxiliary added in v0.4.0

type Auxiliary struct {
	Prefix   string
	Contexts []Context
	Marked   bool
}

type Config added in v0.3.0

type Config struct {
	Level      Level
	TrackLevel Level
	ExitLevel  Level
	Filter     Filter
}

func NewConfig added in v0.3.0

func NewConfig() *Config

func (*Config) WithExitLevel added in v0.4.0

func (this *Config) WithExitLevel(level Level) *Config

func (*Config) WithFilter added in v0.4.0

func (this *Config) WithFilter(filter Filter) *Config

func (*Config) WithLevel added in v0.3.0

func (this *Config) WithLevel(level Level) *Config

func (*Config) WithTrackLevel added in v0.4.0

func (this *Config) WithTrackLevel(level Level) *Config

type Context added in v0.3.0

type Context struct {
	Key   string
	Value string
}

type Filter added in v0.4.0

type Filter func(*Record) bool

type Formatter

type Formatter interface {
	Format(record *Record) []byte
}

type Level added in v0.4.0

type Level int
const (
	LevelTrace Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
	LevelOff
)

type Logger

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

func New added in v0.3.0

func New(config *Config) *Logger

func (Logger) Busy added in v0.4.0

func (this Logger) Busy(slot Slot) bool

func (Logger) BusySlots added in v0.4.0

func (this Logger) BusySlots() []Slot
func (this Logger) CopyLink(dst, src Slot)

func (*Logger) Debug

func (this *Logger) Debug(args ...interface{})

func (*Logger) Debugf

func (this *Logger) Debugf(fmtstr string, args ...interface{})

func (*Logger) Error

func (this *Logger) Error(args ...interface{})

func (*Logger) Errorf

func (this *Logger) Errorf(fmtstr string, args ...interface{})

func (Logger) ExitLevel added in v0.4.0

func (this Logger) ExitLevel() Level

func (*Logger) Fatal

func (this *Logger) Fatal(args ...interface{})

func (*Logger) Fatalf

func (this *Logger) Fatalf(fmtstr string, args ...interface{})

func (Logger) Filter added in v0.4.0

func (this Logger) Filter() Filter

func (Logger) FreeSlots added in v0.4.0

func (this Logger) FreeSlots() []Slot

func (*Logger) Info

func (this *Logger) Info(args ...interface{})

func (*Logger) Infof

func (this *Logger) Infof(fmtstr string, args ...interface{})

func (Logger) Level added in v0.4.0

func (this Logger) Level() Level
func (this Logger) Link(slot Slot, ft Formatter, wt Writer, opts ...interface{})

func (Logger) LinkFilter added in v0.4.0

func (this Logger) LinkFilter(slot Slot) Filter

func (Logger) LinkFormatter added in v0.4.0

func (this Logger) LinkFormatter(slot Slot) Formatter

func (Logger) LinkLevel added in v0.4.0

func (this Logger) LinkLevel(slot Slot) Level

func (Logger) LinkWriter added in v0.4.0

func (this Logger) LinkWriter(slot Slot) Writer

func (*Logger) Log

func (this *Logger) Log(calldepth int, level Level, args ...interface{})

func (*Logger) Logf

func (this *Logger) Logf(calldepth int, level Level, fmtstr string, args ...interface{})
func (this Logger) MoveLink(to, from Slot)

func (*Logger) Panic added in v0.3.0

func (this *Logger) Panic(args ...interface{})

func (*Logger) Panicf added in v0.3.0

func (this *Logger) Panicf(fmtstr string, args ...interface{})

func (Logger) SetExitLevel added in v0.4.0

func (this Logger) SetExitLevel(level Level)

func (Logger) SetFilter added in v0.4.0

func (this Logger) SetFilter(filter Filter)

func (Logger) SetLevel added in v0.3.0

func (this Logger) SetLevel(level Level)

func (Logger) SetLinkFilter added in v0.4.0

func (this Logger) SetLinkFilter(slot Slot, filter Filter) bool

func (Logger) SetLinkFormatter added in v0.4.0

func (this Logger) SetLinkFormatter(slot Slot, ft Formatter) bool

func (Logger) SetLinkLevel added in v0.4.0

func (this Logger) SetLinkLevel(slot Slot, level Level) bool

func (Logger) SetLinkWriter added in v0.4.0

func (this Logger) SetLinkWriter(slot Slot, wt Writer) bool

func (Logger) SetTrackLevel added in v0.4.0

func (this Logger) SetTrackLevel(level Level)
func (this Logger) SwapLink(left, right Slot)

func (*Logger) Time added in v0.3.0

func (this *Logger) Time(args ...interface{}) func()

func (*Logger) Timef added in v0.3.0

func (this *Logger) Timef(fmtstr string, args ...interface{}) func()

func (*Logger) Trace added in v0.2.0

func (this *Logger) Trace(args ...interface{})

func (*Logger) Tracef added in v0.2.0

func (this *Logger) Tracef(fmtstr string, args ...interface{})

func (Logger) TrackLevel added in v0.4.0

func (this Logger) TrackLevel() Level
func (this Logger) Unlink(slot Slot)

func (Logger) UnlinkAll

func (this Logger) UnlinkAll()

func (*Logger) Warn

func (this *Logger) Warn(args ...interface{})

func (*Logger) Warnf

func (this *Logger) Warnf(fmtstr string, args ...interface{})

func (*Logger) WithContext added in v0.3.0

func (this *Logger) WithContext(kvs ...interface{}) *Logger

func (*Logger) WithMark added in v0.3.0

func (this *Logger) WithMark(ok bool) *Logger

func (*Logger) WithPrefix added in v0.3.0

func (this *Logger) WithPrefix(prefix string) *Logger

type Record

type Record struct {
	Time  time.Time
	Level Level
	File  string
	Line  int
	Pkg   string
	Func  string
	Msg   string
	Aux   Auxiliary
}

type Slot added in v0.4.0

type Slot int
const (
	Slot0 Slot = iota
	Slot1
	Slot2
	Slot3
	Slot4
	Slot5
	Slot6
	Slot7
	MaxSlot
)

type Writer

type Writer interface {
	Write(bs []byte, record *Record)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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