log

package
v0.0.0-...-fcb1709 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorOutput

func ErrorOutput(str string)

ErrorOutput writes error using default factory

func SystemOutput

func SystemOutput(str string)

SystemOutput writes output using default factory

Types

type Factory

type Factory struct {
	Logs    map[string]*Log
	Padding int
	Name    string
}

Factory is a factory of individual logs

var DefaultFactory *Factory

Default factory for creating loggers

func NewFactory

func NewFactory() (of *Factory)

NewFactory is a Log factory constructor

func (*Factory) CreateLog

func (of *Factory) CreateLog(name string, index int, isError bool) *Log

CreateLog create a new Log structure

func (*Factory) ErrorOutput

func (of *Factory) ErrorOutput(str string)

ErrorOutput writes safely (using mutex) to error output (from system's name)

func (*Factory) SystemOutput

func (of *Factory) SystemOutput(str string)

SystemOutput prints a given string safely (using mutex) to output (from system's name)

type Log

type Log struct {
	Name    string
	Color   ct.Color
	IsError bool
	Factory *Factory
}

Log represents a named colorful logger

func (*Log) Println

func (o *Log) Println(str string)

Println writes a given string to logger's stream

func (*Log) Write

func (o *Log) Write(b []byte) (num int, err error)

Write safely (using mutex) to a specific log

Jump to

Keyboard shortcuts

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