logger

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a logger worker, using the resource names defined in the supplied config.

func NewLogger

func NewLogger(api LoggerAPI, tag names.Tag, loggingOverride string, updateCallback func(string) error) (worker.Worker, error)

NewLogger returns a worker.Worker that uses the notify watcher returned from the setup.

Types

type Logger

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

Logger is responsible for updating the loggo configuration when the environment watcher tells the agent that the value has changed.

func (*Logger) Handle

func (logger *Logger) Handle(_ <-chan struct{}) error

func (*Logger) SetUp

func (logger *Logger) SetUp() (watcher.NotifyWatcher, error)

func (*Logger) TearDown

func (logger *Logger) TearDown() error

type LoggerAPI

type LoggerAPI interface {
	LoggingConfig(agentTag names.Tag) (string, error)
	WatchLoggingConfig(agentTag names.Tag) (watcher.NotifyWatcher, error)
}

LoggerAPI represents the API calls the logger makes.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName       string
	APICallerName   string
	UpdateAgentFunc func(string) error
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

Jump to

Keyboard shortcuts

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