glogger

package
v0.0.0-...-f3abbe6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level string
const (
	LevelDebg    Level = "DEBG"
	LevelInfo    Level = "INFO"
	LevelWarn    Level = "WARN"
	LevelErro    Level = "ERRO"
	LevelFata    Level = "FATA"
	LevelSuccess Level = "OK"
)

type Log

type Log struct {
	Time     time.Time
	Level    Level
	Text     string
	Reverse1 string            `json:"Reverse1,omitempty" bson:"Reverse1,omitempty"`
	Reverse2 string            `json:"Reverse2,omitempty" bson:"Reverse2,omitempty"`
	Reverse3 string            `json:"Reverse3,omitempty" bson:"Reverse3,omitempty"`
	Reverse4 string            `json:"Reverse4,omitempty" bson:"Reverse4,omitempty"`
	Reverse5 string            `json:"Reverse5,omitempty" bson:"Reverse5,omitempty"`
	ExtTags  map[string]string `json:"ExtTags,omitempty" bson:"ExtTags,omitempty"`
}

func NewLog

func NewLog(level Level, time time.Time, text string) Log

func (*Log) GetExtTag

func (l *Log) GetExtTag(key string) string

func (*Log) GetExtTagEx

func (l *Log) GetExtTagEx(key string) (string, bool)

func (*Log) SetExtTag

func (l *Log) SetExtTag(key, value string) *Log

func (*Log) SetReverse1

func (l *Log) SetReverse1(value string) *Log

func (*Log) SetReverse2

func (l *Log) SetReverse2(value string) *Log

func (*Log) SetReverse3

func (l *Log) SetReverse3(value string) *Log

func (*Log) SetReverse4

func (l *Log) SetReverse4(value string) *Log

func (*Log) SetReverse5

func (l *Log) SetReverse5(value string) *Log

type Logger

type Logger interface {
	Debgf(format string, a ...interface{})
	Infof(format string, a ...interface{})
	Warnf(format string, a ...interface{})
	Errof(format string, a ...interface{})
	Fataf(format string, a ...interface{})

	Erro(err error, wrapMsg ...string)
	Fata(err error, wrapMsg ...string)
	AssertOk(err error, wrapMsg ...string)
	AssertTrue(express bool, wrapMsg ...string)
}

Jump to

Keyboard shortcuts

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