console

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package console defines the logging console stream and console stream creation strategy to be integrated into the logging package stream factory instance.

Index

Constants

View Source
const (
	// ID defines the application container registration string for the
	// console stream strategy.
	ID = stream.ID + ".console"
)
View Source
const (
	// Type defines the value to be used to declare a
	// console Log stream type.
	Type = "console"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider defines the slate.config module service provider to be used on the application initialization to register the config service.

func (Provider) Boot

func (p Provider) Boot(
	container slate.IContainer,
) error

Boot will start the configuration config instance by calling the configuration loader with the defined provider base entry information.

func (Provider) Register

func (Provider) Register(
	container slate.IContainer,
) error

Register will register the configuration section instances in the application container.

type Stream

type Stream struct {
	stream.Stream
}

Stream defines an instance to a console log output stream.

func NewStream

func NewStream(
	formatter log.IFormatter,
	channels []string,
	level log.Level,
) (*Stream, error)

NewStream generate a new console log stream instance.

type StreamStrategy

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

StreamStrategy defines a console log stream generation strategy.

func NewStreamStrategy

func NewStreamStrategy(
	formatterFactory log.IFormatterFactory,
) (*StreamStrategy, error)

NewStreamStrategy generates a new console log stream generation strategy instance.

func (StreamStrategy) Accept

func (s StreamStrategy) Accept(
	cfg config.IConfig,
) bool

Accept will check if the stream factory strategy can instantiate a stream where the data to check comes from a configuration partial instance.

func (StreamStrategy) Create

func (s StreamStrategy) Create(
	cfg config.IConfig,
) (log.IStream, error)

Create will instantiate the desired stream instance where the initialization data comes from a configuration instance.

Jump to

Keyboard shortcuts

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