logging

package
v0.0.0-...-ff27e19 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Transport
}

Service represents a Logging service instance.

func MustNewService

func MustNewService(factory func() (Transport, error)) *Service

MustNewService does the same thing as NewService, but panics on error.

func NewService

func NewService(factory func() (Transport, error)) (srv *Service, err error)

NewService uses the factory function passed into it to construct a logging transport, which is then used as the underlying transport for the Service instance returned.

Any panics in the factory function are turned into errors, so it is safe to panic when the transport creation process fails to save some if errs.

type Transport

type Transport interface {
	services.Transport

	Tracef(format string, params ...interface{})
	Debugf(format string, params ...interface{})
	Infof(format string, params ...interface{})
	Warnf(format string, params ...interface{}) error
	Errorf(format string, params ...interface{}) error
	Criticalf(format string, params ...interface{}) error

	Trace(v ...interface{})
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{}) error
	Error(v ...interface{}) error
	Critical(v ...interface{}) error

	// Flush is there just in case the transport decides to implement some kind
	// of buffering. Flush should force the transport to send the logs immediately.
	Flush()
}

Transport interface for logging defines a set of common methods any other logger would implement. The task of structs implementing this interface is to stream the inserted log records to the Meeko broker, where they are processed centrally.

Jump to

Keyboard shortcuts

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