logger

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 1

Documentation

Overview

Package logger is the central log repository for gopher2600. There is a single log for the entire application and can be accessed through the package level functions, principally Log().

Log entries can be grouped together with the tag argument in the Log() command.

The logger package should not be used inside any init() function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

Clear all entries from central logger.

func Log

func Log(tag, detail string)

Log adds an entry to the central logger.

func Logf added in v0.10.1

func Logf(tag, detail string, args ...interface{})

Logf adds a formatted entry to the central logger.

func SetEcho added in v0.7.1

func SetEcho(output io.Writer)

SetEcho to print new entries to os.Stdout.

func Tail

func Tail(output io.Writer, number int)

Tail writes the last N entries to io.Writer.

func TimeOfLast added in v0.10.1

func TimeOfLast() int

TimeOfLast returns the timestamp in nanoseconds of the most recent log event.

func Write

func Write(output io.Writer)

Write contents of central logger to io.Writer.

func WriteRecent added in v0.7.1

func WriteRecent(output io.Writer)

WriteRecent returns only the entries added since the last call to CopyRecent.

Types

type Entry

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

Entry represents a single line/entry in the log.

func Copy added in v0.7.1

func Copy() []Entry

Slice returns a copy all log entries.

func (*Entry) String added in v0.7.1

func (e *Entry) String() string

Jump to

Keyboard shortcuts

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