output

package
v0.0.0-...-aefecf9 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SourceConfig    config.SourceConfig
	InstallConfig   installer.InstallConfig
	PreparedInstall installer.PreparedInstall
	IsVerbose       bool
}

Config is a object used to configure the output logger.

type Output

type Output struct {
	Config
	// contains filtered or unexported fields
}

Output represents a service object used to output logging information about dotfile installation operations.

func New

func New(config Config) *Output

New creates a output logger given a configuration.

func (*Output) DotfileInfo

func (l *Output) DotfileInfo(dotfile *installer.PreparedDotfile)

DotfileInfo outputs information about a single prepared dotfile. Will not output anything without IsInfo. When IsVerbose is enabled additional information about the prepared dotfile will be included.

func (*Output) DryrunInstall

func (l *Output) DryrunInstall()

DryrunInstall outputs the logging of a dryrun of the prepared dotfiles

func (*Output) GetEventChan

func (l *Output) GetEventChan() chan<- events.Event

GetEventChan returns the event channel that may be sent events to be outputted while the logger listening for events.

func (*Output) InstallInfo

func (l *Output) InstallInfo()

InstallInfo outputs details about the pending installation. Output is only performed when verbosity is enabled.

func (*Output) LogEvents

func (l *Output) LogEvents() func()

LogEvents processes the Events channel and output logging for each event processed on the channel. A function is returned that when called will stop processing.

Typically this should be called with a defer, e.g:

defer myLogger.LogEvents()()

Jump to

Keyboard shortcuts

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