log

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package io contains helper functions related to io This file contains an interface to print output to io in various colors and modes

Index

Constants

View Source
const (
	NO_SPACES    = ""
	TWO_SPACES   = "  "
	FOUR_SPACES  = "  "
	SIX_SPACES   = "  "
	EIGHT_SPACES = "  "
)
View Source
const (
	VERB_NONE = "VERB_NONE" // Does not Show INFO tag in verbose mode (only activates in verbose mode)
	INFO_NONE = "INFO_NONE" // Only Shows text in Verbose mode
	NONE      = "NONE"      // Does not show INFO tag in regular mode
	INFO      = "INFO"      // Shows like a normal text in regular mode and INFO tag in verbose mode
	VERB      = "VERB"
	ERR       = "ERR"
	WARN      = "WARN"
)

Variables

This section is empty.

Functions

func CopyQueue

func CopyQueue(fromQueue *Queue, toQueue *Queue, spaces string)

Copy one queue to another

func DisableWarnings

func DisableWarnings()

Disable all the warning shown by wio

func Init

func Init()

This must be called at the beggining

func IsVerbose

func IsVerbose() bool

This returns true if verbose mode is on and false otherwise

func PrintQueue

func PrintQueue(queue *Queue, spaces string)

Print Queue on the console

func QueueWrite

func QueueWrite(queue *Queue, logType string, providedColor *color.Color, message string, a ...interface{})

Write Queue

func QueueWriteln

func QueueWriteln(queue *Queue, logType string, providedColor *color.Color, message string, a ...interface{})

Writeln Queue

func SetVerbose

func SetVerbose()

Turns verbose mode on. This is the mode when Verbose functions work

func Write

func Write(logType string, providedColor *color.Color, message string, a ...interface{}) bool

Generic Write function

func WriteErrorAndPrompt

func WriteErrorAndPrompt(err error, logType string, promptRightAnswer string, caseSensitive bool)

Record error/warning to stderr and prompts user for a choice and based on that decides to exists or not

func WriteErrorln

func WriteErrorln(err error, isWarning bool)

Record error/warning to stderr and prints a new line

func WriteErrorlnExit

func WriteErrorlnExit(err error)

Record error to stderr and prints a new line. It also exists the program with an error code

func Writeln

func Writeln(logType string, providedColor *color.Color, message string, a ...interface{}) bool

Generic Writeln function

Types

type Queue

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

Queue is a basic FIFO queue based on a circular list that resizes as needed.

func GetQueue

func GetQueue() *Queue

This provides a queue that can be used to log at different levels

func NewQueue

func NewQueue(size int) *Queue

NewQueue returns a new queue with the given initial size.

Jump to

Keyboard shortcuts

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