log

package
v0.0.0-...-7bd4979 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 9 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirectoryIfNotExists

func CreateDirectoryIfNotExists(dir string)

func TerminalFormat

func TerminalFormat(r *Record) string

Types

type Ctx

type Ctx map[string]interface{}

type Logger

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

func GetLogger

func GetLogger() *Logger

func (*Logger) Crit

func (l *Logger) Crit(msg string, ctx ...interface{})

func (*Logger) Debug

func (l *Logger) Debug(msg string, ctx ...interface{})

func (*Logger) Error

func (l *Logger) Error(msg string, ctx ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string, ctx ...interface{})

func (*Logger) Trace

func (l *Logger) Trace(msg string, ctx ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string, ctx ...interface{})

type LoggerInterface

type LoggerInterface interface {
	Trace(msg string, ctx ...interface{})
	Debug(msg string, ctx ...interface{})
	Info(msg string, ctx ...interface{})
	Warn(msg string, ctx ...interface{})
	Error(msg string, ctx ...interface{})
	Crit(msg string, ctx ...interface{})
}

type Record

type Record struct {
	Time time.Time
	//Lvl      Lvl
	Msg string
	Ctx []interface{}
	//Call     stack.Call
	KeyNames RecordKeyNames
}

A Record is what a LoggerInterface asks its handler to write

type RecordKeyNames

type RecordKeyNames struct {
	Time string
	Msg  string
	Lvl  string
}

Jump to

Keyboard shortcuts

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