logger

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2016 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsoleChan = make(ChanChanMessage)

The main channel for logging

View Source
var IsVerbose bool

If true, lots of things will print

Functions

This section is empty.

Types

type ChanChanMessage

type ChanChanMessage chan ChanMessage

Channel of Channels of ConsoleMessages Used to maintain order Ex: A create connection thread is started, all messages related to the creation of that connection will go in its own channel, which will then go in a channel full of other channels

func (ChanChanMessage) AddError

func (ccm ChanChanMessage) AddError(err error, message string)

func (ChanChanMessage) AddInfo

func (ccm ChanChanMessage) AddInfo(message string)

func (ChanChanMessage) AddPriority

func (ccm ChanChanMessage) AddPriority(message string)

func (ChanChanMessage) AddVerbose

func (ccm ChanChanMessage) AddVerbose(message string)

Add a verbose message to the main channel

type ChanMessage

type ChanMessage chan ConsoleMessage

Channel of ConsoleMessages

func (ChanMessage) AddError

func (cc ChanMessage) AddError(err error, message string)

func (ChanMessage) AddInfo

func (cc ChanMessage) AddInfo(message string)

func (ChanMessage) AddPriority

func (cc ChanMessage) AddPriority(message string)

func (ChanMessage) AddVerbose

func (cc ChanMessage) AddVerbose(message string)

Add a verbose message to a sub-channel

type ConsoleMessage

type ConsoleMessage struct {
	Level   Level // -1 verbose; 0 info; 1 important; 2 warning; 3 error;
	Message string
	Error   error
}

Format for messages that will be printed on the console

type Level

type Level int

Logger level enum

const (
	VERBOSE Level = iota
	INFO
	PRIORITY
	WARNING
	ERROR
)

Jump to

Keyboard shortcuts

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