logger

package
v10.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMainLogger

func InitMainLogger(currentVersion string) error

InitMainLogger creates a global instance of the main logger

func IsTerminal

func IsTerminal() bool

IsTerminal returns a bool if it is stderr

Types

type Client

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

Client defines the logger struct

func (*Client) Clear

func (client *Client) Clear() error

Clear the streams

func (*Client) Close

func (client *Client) Close() error

Close the streams

func (*Client) Get

func (client *Client) Get() []byte

Get the in-memory stream

func (*Client) Stream

func (client *Client) Stream() io.Writer

Stream returns a Writer stream to multiple internal streams

type FakeMainLogger

type FakeMainLogger interface {
	Clear() error
	Close() error
	Info(key, msg string)
	Error(key, msg string, err error)
}

FakeMainLogger is a fake interface of the main logger

func NewFakeMainLogger

func NewFakeMainLogger() FakeMainLogger

NewFakeMainLogger creates a fake instance of the logger

type Logger

type Logger interface {
	Stream() io.Writer
	Clear() error
	Get() []byte
	Close() error
}

Logger defines the interface for logging to mult-streams

func NewLogger

func NewLogger(filePath string, isErrorStream bool) (Logger, error)

NewLogger creates an instance of a logger

type MainClient

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

MainClient defines the mainlogger struct

func (*MainClient) Clear

func (client *MainClient) Clear() error

Clear the stream

func (*MainClient) Close

func (client *MainClient) Close() error

Close the stream

func (*MainClient) Error

func (client *MainClient) Error(key, msg string, err error)

Error log a message

func (*MainClient) Info

func (client *MainClient) Info(key, msg string)

Info log a message

type MainLogger

type MainLogger interface {
	Clear() error
	Close() error
	Info(key, msg string)
	Error(key, msg string, err error)
}

MainLogger defines the interface for logging to stderr or stdout

func GetMainLogger

func GetMainLogger() MainLogger

GetMainLogger gets the global instance of the MainLogger

type Streams

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

Streams defines the streams supported by the logger

Jump to

Keyboard shortcuts

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