gapplog

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 6 Imported by: 1

README

gapp-log

Documentation

Index

Constants

View Source
const (
	// ContainerID defines the id to be used as the container
	// registration id of a logger instance, as a base id of all other log
	// package instances registered in the application container.
	ContainerID = gapp.ContainerID + ".log"

	// ContainerFormatterStrategyTag defines the tag to be assigned to all
	// container formatter strategies.
	ContainerFormatterStrategyTag = ContainerID + ".formatter.strategy"

	// ContainerFormatterStrategyJSONID defines the id to be used as
	// the container registration id of a logger json formatter factory
	// strategy instance.
	ContainerFormatterStrategyJSONID = ContainerID + ".formatter.strategy.json"

	// ContainerFormatterFactoryID defines the id to be used as the
	// container registration id of a logger formatter factory instance.
	ContainerFormatterFactoryID = ContainerID + ".formatter.factory"

	// ContainerStreamStrategyTag defines the tag to be assigned to all
	// container stream strategies.
	ContainerStreamStrategyTag = ContainerID + ".stream.strategy"

	// ContainerStreamStrategyConsoleID defines the id to be used as the
	// container registration id of a logger console stream factory strategy
	// instance.
	ContainerStreamStrategyConsoleID = ContainerID + ".stream.strategy.console"

	// ContainerStreamStrategyFileID defines the id to be used as the
	// container registration id of a logger file stream factory strategy
	// instance.
	ContainerStreamStrategyFileID = ContainerID + ".stream.strategy.file"

	// ContainerStreamStrategRotatingFileID defines the id to be used as the
	// container registration id of a logger rotating file stream factory
	// strategy instance.
	ContainerStreamStrategRotatingFileID = ContainerID + ".stream.strategy.rotating_file"

	// ContainerStreamFactoryID defines the id to be used as the container
	// registration id of a logger stream factory instance.
	ContainerStreamFactoryID = ContainerID + ".stream.factory"

	// ContainerLoaderID defines the id to be used as the container
	// registration id of a logger loader instance.
	ContainerLoaderID = ContainerID + ".loader"
)

Variables

View Source
var (
	// ErrNilPointer defines a nil pointer argument error
	ErrNilPointer = gapp.ErrNilPointer

	// ErrConversion defines a type conversion error
	ErrConversion = gapp.ErrConversion
)
View Source
var (
	// LoaderActive defines the entry config source active flag
	// used to signal the config loader to load the streams or not
	LoaderActive = genv.Bool("GAPP_LOG_LOADER_ACTIVE", true)
)

Functions

func GetFormatterFactory added in v1.0.2

func GetFormatterFactory(c gapp.ServiceContainer) (*glog.FormatterFactory, error)

GetFormatterFactory will try to retrieve the registered formatter factory instance from the application service container.

func GetFormatterStrategies added in v1.0.2

func GetFormatterStrategies(c gapp.ServiceContainer) ([]glog.FormatterStrategy, error)

GetFormatterStrategies will try to retrieve the registered the list of formatter strategies instances from the application service container.

func GetLoader added in v1.0.2

func GetLoader(c gapp.ServiceContainer) (*glog.Loader, error)

GetLoader will try to retrieve the registered loader instance from the application service container.

func GetLogger added in v1.0.2

func GetLogger(c gapp.ServiceContainer) (*glog.Logger, error)

GetLogger will try to retrieve the registered logger manager instance from the application service container.

func GetStreamFactory added in v1.0.2

func GetStreamFactory(c gapp.ServiceContainer) (*glog.StreamFactory, error)

GetStreamFactory will try to retrieve the registered stream factory instance from the application service container.

func GetStreamStrategies added in v1.0.2

func GetStreamStrategies(c gapp.ServiceContainer) ([]glog.StreamStrategy, error)

GetStreamStrategies will try to retrieve the registered the list of stream strategies instances from the application service container.

Types

type Provider added in v1.0.2

type Provider struct{}

Provider defines the gapp/log module service provider to be used on the application initialization to register the logging service.

func (Provider) Boot added in v1.0.2

func (p Provider) Boot(c gapp.ServiceContainer) error

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

func (Provider) Register added in v1.0.2

func (p Provider) Register(c gapp.ServiceContainer) error

Register will register the logger package instances in the application container.

Jump to

Keyboard shortcuts

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