log

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

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySetup        = "Setup"
	KeyConfig       = "Config"
	TypeStackdriver = "stackdriver"
	TypeStdout      = "stdout"
)
View Source
const Key = Namespace("log")

Key is a name of the plugin variable

Variables

This section is empty.

Functions

func Infof

func Infof(format force.Expression, args ...interface{}) (force.Action, error)

Infof returns an action that logs in info

func Log

func Log(cfg interface{}) (force.Action, error)

Log returns action that sets up log plugin

func Scope

func Scope() (force.Group, error)

Scope returns a new scope with all the functions and structs defined, this is the entrypoint into plugin as far as force is concerned

Types

type Config

type Config struct {
	// Level is a debugging level
	Level string
	// Outputs is a list of logging outputs
	Outputs []Output
}

Config is a log configuration

func (*Config) CheckAndSetDefaults

func (cfg *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets default values

type InfofAction

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

func (*InfofAction) Eval

func (s *InfofAction) Eval(ctx force.ExecutionContext) (interface{}, error)

func (*InfofAction) MarshalCode

func (s *InfofAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)

MarshalCode marshals the action into code representation

func (*InfofAction) String

func (s *InfofAction) String() string

func (*InfofAction) Type

func (s *InfofAction) Type() interface{}

type Logger

type Logger struct {
	log.FieldLogger
	// contains filtered or unexported fields
}

func (*Logger) AddFields

func (l *Logger) AddFields(fields map[string]interface{}) force.Logger

AddFields adds fields to the logger

func (*Logger) URL

func (l *Logger) URL(ctx force.ExecutionContext) string

func (*Logger) WithError

func (l *Logger) WithError(err error) force.Logger

WithError returns a logger bound to an error

type Namespace

type Namespace string

Namespace is a wrapper around string to namespace a variable in the context

type Output

type Output struct {
	// Type is a logging type, currently supported
	// is stackdriver and stdout
	Type string
	// CredentialsFile is a path to credentials file,
	// used in case of stackdriver plugin
	CredentialsFile string
	// Credentials is a string with creds
	Credentials string
}

Output is a logging output

type Plugin

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

Plugin is a new logging plugin

func (*Plugin) NewLogger

func (p *Plugin) NewLogger() force.Logger

NewLogger generates a new logger for a process

type Setup

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

Setup creates new instances of plugins

func (*Setup) Eval

func (n *Setup) Eval(ctx force.ExecutionContext) (interface{}, error)

Eval sets up logging plugin for the instance group

func (*Setup) MarshalCode

func (n *Setup) MarshalCode(ctx force.ExecutionContext) ([]byte, error)

MarshalCode marshals plugin setup to code

func (*Setup) NewInstance

func (n *Setup) NewInstance(group force.Group) (force.Group, interface{})

NewInstance returns a new instance of a plugin bound to group

func (*Setup) Type

func (n *Setup) Type() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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