log

package
v0.0.0-...-68eb7cf Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StringToLevel = map[string]Level{
	"DEBUG":   DEBUG,
	"INFO":    INFO,
	"WARNING": WARNING,
	"ERROR":   ERROR,
	"FATAL":   FATAL,
}

Functions

func Debug

func Debug(items ...interface{})

func Debugf

func Debugf(format string, items ...interface{})

func Disable

func Disable()

func Disabled

func Disabled() bool

func Error

func Error(items ...interface{})

func Errorf

func Errorf(format string, items ...interface{})

func Fatal

func Fatal(items ...interface{})

func Fatalf

func Fatalf(format string, items ...interface{})

func Info

func Info(items ...interface{})

func Infof

func Infof(format string, items ...interface{})

func InitFromConfig

func InitFromConfig() (err error)

func Warning

func Warning(items ...interface{})

func Warningf

func Warningf(format string, items ...interface{})

Types

type EchoLogger

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

EchoLogger is a fake logger for echo.

func (*EchoLogger) Debug

func (e *EchoLogger) Debug(i ...interface{})

func (*EchoLogger) Debugf

func (e *EchoLogger) Debugf(format string, args ...interface{})

func (*EchoLogger) Debugj

func (e *EchoLogger) Debugj(j log.JSON)

func (*EchoLogger) Error

func (e *EchoLogger) Error(i ...interface{})

func (*EchoLogger) Errorf

func (e *EchoLogger) Errorf(format string, args ...interface{})

func (*EchoLogger) Errorj

func (e *EchoLogger) Errorj(j log.JSON)

func (*EchoLogger) Fatal

func (e *EchoLogger) Fatal(i ...interface{})

func (*EchoLogger) Fatalf

func (e *EchoLogger) Fatalf(format string, args ...interface{})

func (*EchoLogger) Fatalj

func (e *EchoLogger) Fatalj(j log.JSON)

func (*EchoLogger) Info

func (e *EchoLogger) Info(i ...interface{})

func (*EchoLogger) Infof

func (e *EchoLogger) Infof(format string, args ...interface{})

func (*EchoLogger) Infoj

func (e *EchoLogger) Infoj(j log.JSON)

func (*EchoLogger) Level

func (e *EchoLogger) Level() log.Lvl

func (*EchoLogger) Output

func (e *EchoLogger) Output() io.Writer

func (*EchoLogger) Panic

func (e *EchoLogger) Panic(i ...interface{})

func (*EchoLogger) Panicf

func (e *EchoLogger) Panicf(format string, args ...interface{})

func (*EchoLogger) Panicj

func (e *EchoLogger) Panicj(j log.JSON)

func (*EchoLogger) Prefix

func (e *EchoLogger) Prefix() string

func (*EchoLogger) Print

func (e *EchoLogger) Print(i ...interface{})

func (*EchoLogger) Printf

func (e *EchoLogger) Printf(format string, args ...interface{})

func (*EchoLogger) Printj

func (e *EchoLogger) Printj(j log.JSON)

func (*EchoLogger) SetHeader

func (e *EchoLogger) SetHeader(h string)

func (*EchoLogger) SetLevel

func (e *EchoLogger) SetLevel(v log.Lvl)

func (*EchoLogger) SetOutput

func (e *EchoLogger) SetOutput(w io.Writer)

func (*EchoLogger) SetPrefix

func (e *EchoLogger) SetPrefix(p string)

func (*EchoLogger) Warn

func (e *EchoLogger) Warn(i ...interface{})

func (*EchoLogger) Warnf

func (e *EchoLogger) Warnf(format string, args ...interface{})

func (*EchoLogger) Warnj

func (e *EchoLogger) Warnj(j log.JSON)

type GormLogger

type GormLogger struct{}

func (GormLogger) Error

func (GormLogger) Error(_ context.Context, msg string, param ...interface{})

func (GormLogger) Info

func (GormLogger) Info(_ context.Context, msg string, param ...interface{})

func (GormLogger) LogMode

func (GormLogger) Trace

func (GormLogger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error)

func (GormLogger) Warn

func (GormLogger) Warn(_ context.Context, msg string, param ...interface{})

type Level

type Level int

Level for logs.

const (
	DEBUG Level = iota
	INFO
	WARNING
	ERROR
	FATAL
)

Debug: debug information. Info: Running information. Warning: notable, but the process wont fail because of this. Error: a process (request) fails because of this. Fatal: multiple process(request) fails because of this.

func (Level) String

func (l Level) String() string

type Log

type Log struct {
	Level   Level     `json:"level"`   // The level of this log.
	Time    time.Time `json:"time"`    // The time of this log.
	Message string    `json:"message"` // The message of this log.
	Caller  string    `json:"caller"`  // The function produces this log.
}

Log struct contains essential information of a log.

Jump to

Keyboard shortcuts

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