consolelogger

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package consolelogger defines a logger.Interface that emits logs to a writer (usually the console)

Index

Constants

View Source
const ClearScreen = "\033[H\033[2J"

ClearScreen is the control code to clear the screen

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Writer io.Writer // where to print the logs
	// contains filtered or unexported fields
}

Logger is a logger.Interface that emits logs to a writer (usually the console)

func (*Logger) Error

func (l *Logger) Error(url string, err error)

Error is called on every error

func (*Logger) Exit

func (l *Logger) Exit()

Exit stops the status ticker, and prints a sorted list of the successful urls

func (*Logger) Finished

func (l *Logger) Finished(url string, code int, latency time.Duration, urls, errors int)

Finished is called each time a URL successfully finishes processing (even for non-200 results)

func (*Logger) Init

func (l *Logger) Init()

Init initialises the logger and starts the summary ticker

func (*Logger) Queued

func (l *Logger) Queued(url string)

Queued is called each time a url is successfully queued

func (*Logger) Starting

func (l *Logger) Starting(url string)

Starting is called each time a url starts processing

Jump to

Keyboard shortcuts

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