logger

package
v0.0.0-...-9799ab4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: GPL-3.0 Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SEP = []byte("\n")
View Source
var SEP_LEN = len(SEP)

Functions

This section is empty.

Types

type EntryType

type EntryType uint
const (
	TextEntryType EntryType = iota
	InfoEntryType
	WarningEntryType
	ErrorEntryType
)

type LineByLineWriter

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

func NewLineByLineWriter

func NewLineByLineWriter(l *Logger, err_logger bool) *LineByLineWriter

func (*LineByLineWriter) Write

func (self *LineByLineWriter) Write(p []byte) (n int, err error)

type LogEntry

type LogEntry struct {
	Type EntryType
	Time time.Time
	Text string
}

func (*LogEntry) TypeString

func (self *LogEntry) TypeString() string

func (*LogEntry) TypeStringT

func (self *LogEntry) TypeStringT() string

type Logger

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

func New

func New() *Logger

func (*Logger) AddOutput

func (self *Logger) AddOutput(out interface{}) uint64

out type must conform to io.Writer, io.WriteCloser or LoggerI

func (*Logger) AddOutputOpt

func (self *Logger) AddOutputOpt(out interface{}, opts *OutputOptions) uint64

out type must conform to io.Writer or io.WriteCloser

func (*Logger) Close

func (self *Logger) Close()

func (*Logger) ConnectCallback

func (self *Logger) ConnectCallback(callback LoggerCallback)

func (*Logger) DelOutput

func (self *Logger) DelOutput(id uint64)

func (*Logger) Error

func (self *Logger) Error(value interface{})

func (*Logger) Info

func (self *Logger) Info(txt string)

func (*Logger) PutEntry

func (self *Logger) PutEntry(type_ EntryType, value interface{})

func (*Logger) PutEntryComplete

func (self *Logger) PutEntryComplete(entry *LogEntry)

func (*Logger) ResetOutput

func (self *Logger) ResetOutput()

func (*Logger) StderrLbl

func (self *Logger) StderrLbl() *LineByLineWriter

func (*Logger) StdoutLbl

func (self *Logger) StdoutLbl() *LineByLineWriter

func (*Logger) Text

func (self *Logger) Text(txt string)

func (*Logger) Warning

func (self *Logger) Warning(txt string)

type LoggerCallback

type LoggerCallback func(*LogEntry, *Logger)

type LoggerI

type LoggerI interface {
	Text(string)
	Info(string)
	Warning(string)
	Error(interface{})
	PutEntry(type_ EntryType, value interface{})
	PutEntryComplete(entry *LogEntry)
}

type OutputOptions

type OutputOptions struct {
	TextIcon       string
	InfoIcon       string
	WarningIcon    string
	ErrorIcon      string
	InsertTime     bool
	TimeLayout     string
	ClosedByLogger bool
}

type WriterWrapper

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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