logs

package
v1.0.181 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: GPL-3.0 Imports: 13 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 BadWriter = errors.New("BadWriter, needs to be deleted from mutiwriter")

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 formated(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 MultiWriter added in v1.0.12

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

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

Jump to

Keyboard shortcuts

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