logs

package
v1.0.327 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package logs output logs and advanced debug information

Index

Constants

View Source
const (
	LogPutColor = "\033["
	LogEndColor = "\033[0m"
)

Variables

View Source
var ErrBadWriter = errors.New("ErrBadWriter, it will be deleted from multiwriter")

Functions

func DebugLog

func DebugLog(args ...interface{})

DebugLog output formated(function and line calls) debug information

func DeleteWriters added in v1.0.12

func DeleteWriters(writerToDelete io.Writer, logFlags ...FgLogWriter)

DeleteWriters deletes mentioned writer from writers for mentioned logFlag

func ErrorLog

func ErrorLog(err error, args ...interface{})

ErrorLog - output formatted (function and line calls) error information

func ErrorLogHandler

func ErrorLogHandler(err error, args ...interface{})

ErrorLogHandler - output formatted(function and line calls) error information

func ErrorStack

func ErrorStack(err error, args ...interface{})

ErrorStack - output formatted (function and line calls) error runtime stack information

func Fatal

func Fatal(err error, args ...interface{})

Fatal - output formated (function and line calls) fatal information

func GetStack added in v1.0.293

func GetStack(i int, stackLine string) string

func MultiWriter added in v1.0.12

func MultiWriter(writers ...io.Writer) io.Writer

creates a multiwriter

func NewWrapKitLogger

func NewWrapKitLogger(pref string, depth int) *wrapKitLogger

func NewlogMess

func NewlogMess(mess string, logger *wrapKitLogger) *logMess

func SetDebug

func SetDebug(d bool) bool

SetDebug set debug level for log, return old value

func SetLogFlags

func SetLogFlags(f int) int

SetLogFlags set logger flags & return old flags

func SetSentry

func SetSentry(dns string, org string) error

SetSentry set SetSentry output for error

func SetStackBeginWith

func SetStackBeginWith(s int) int

SetStackBeginWith set stackBeginWith level for log, return old value

func SetStatus

func SetStatus(s bool) bool

SetStatus set status level for log, return old value

func SetWriters

func SetWriters(newWriter io.Writer, logFlags ...FgLogWriter)

SetWriters for logs

func StatusLog

func StatusLog(args ...interface{})

StatusLog output formatted information for status

func TraceLog

func TraceLog(args ...interface{})

TraceLog output formatted(function and line calls) debug information

Types

type FgLogWriter

type FgLogWriter int8
const (
	FgAll FgLogWriter = iota
	FgErr
	FgInfo
	FgDebug
)

type Level

type Level int
const (
	CRITICAL Level = iota
	ERROR
	WARNING
	NOTICE
	INFO
	DEBUG
)

type LogsType

type LogsType interface {
	PrintToLogs() string
}

LogsType - interface for print logs record

type MultiwriterErr added in v1.0.22

type MultiwriterErr struct {
	ErrorsList []WriterErr
}

func (MultiwriterErr) Error added in v1.0.22

func (mwe MultiwriterErr) Error() string

func (MultiwriterErr) String added in v1.0.290

func (mwe MultiwriterErr) String() string

type WriterErr added in v1.0.22

type WriterErr struct {
	Err error
	Wr  io.Writer
}

Jump to

Keyboard shortcuts

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