alog

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 10 Imported by: 0

README

ALog - Fast and asynchronous logger GoDoc GitHub tag

License FOSSA Status ALog codecov Scrutinizer Code Quality Sourcegraph HitCount

GolangCI Go Report Card Codacy Badge Maintainability codebeat badge

Install

go get -u github.com/mylockerteam/alog

Configure

License

FOSSA Status

Documentation

Index

Constants

View Source
const (
	Info uint = iota
	Wrn
	Err
)

Logger types

Variables

This section is empty.

Functions

func Name added in v0.0.11

func Name(code uint) string

Name returns a name for the logger. It returns the empty string if the code is unknown.

Types

type Config

type Config struct {
	Loggers        Map
	TimeFormat     string
	IgnoreFileLine bool
}

Config contains settings and registered loggers

type Log

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

Log logger himself

func (*Log) Error

func (a *Log) Error(err error) *Log

Method for recording errors without stack

func (*Log) ErrorDebug

func (a *Log) ErrorDebug(err error) *Log

ErrorDebug method for recording errors with stack

func (*Log) GetLoggerInterfaceByType added in v0.0.11

func (a *Log) GetLoggerInterfaceByType(loggerType uint) io.Writer

GetLoggerInterfaceByType returns io.Writer interface for logging in third-party libraries

func (*Log) Info

func (a *Log) Info(msg string) *Log

Info method for recording informational messages

func (*Log) Infof

func (a *Log) Infof(format string, p ...interface{}) *Log

Infof method of recording formatted informational messages

func (*Log) Warning

func (a *Log) Warning(msg string) *Log

Warning method for recording warning messages

type Logger

type Logger struct {
	io.Writer
	Channel    chan string
	Strategies []io.Writer
}

Logger logger structure which includes a channel and a slice strategies

func (*Logger) Reader added in v0.0.11

func (l *Logger) Reader()

Reader for messages

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Writer interface for informational messages

type Map added in v0.0.11

type Map map[uint]*Logger

Map mapping for type:logger

type Writer added in v0.0.11

type Writer interface {
	Info(msg string) *Log
	Infof(format string, p ...interface{}) *Log
	Warning(msg string) *Log
	Error(err error) *Log
	ErrorDebug(err error) *Log
	GetLoggerInterfaceByType(loggerType uint) io.Writer
}

Writer interface for loggers

func Create

func Create(config *Config) Writer

Create creates an instance of the logger

func Default added in v0.0.11

func Default(chanBuffer uint) Writer

Default created standart logger. Writes to stdout and stderr

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
strategy

Jump to

Keyboard shortcuts

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