logs

package
v0.0.0-...-a568446 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAppOptions = AppOptions{
	AppHost: "localhost",
}

DefaultAppOptions Default app options

View Source
var DefaultElkOptions = ElkOptions{
	ElkDsn:            "http://localhost:9200",
	ElkIndex:          "org.module.app.%s",
	ElkSync:           true,
	ElkSniff:          false,
	ElkHealth:         true,
	ElkHealthInterval: time.Second * 30,
	ElkHealthTimeout:  time.Second * 3,
}

DefaultElkOptions Default elastic options

DefaultOptions Default options

Functions

func Init

func Init(fns ...OptionsFn)

Init Init new instance

func New

func New(fns ...OptionsFn) *logrus.Logger

New Init new log

func Single

func Single() *logrus.Logger

Single Use a silgle log instance

Types

type AppOptions

type AppOptions struct {
	AppHost string
	// contains filtered or unexported fields
}

AppOptions Application options

type ElkOptions

type ElkOptions struct {
	ElkDsn            string
	ElkIndex          string
	ElkSync           bool
	ElkSniff          bool
	ElkHealth         bool
	ElkHealthInterval time.Duration
	ElkHealthTimeout  time.Duration
	// contains filtered or unexported fields
}

ElkOptions Elastic options

type Options

type Options struct {
	AppOptions
	ElkOptions
}

Options Log options

type OptionsFn

type OptionsFn func(*logrus.Logger, *Options)

OptionsFn Options function type

func SetDiscardOutput

func SetDiscardOutput() OptionsFn

SetDiscardOutput Defines if should discard output

func SetElkSync

func SetElkSync(b bool) OptionsFn

SetElkSync Defines if should sync elk

func SetTestingMode

func SetTestingMode() OptionsFn

SetTestingMode Testing mode discards the outputs and doesn't sync elk

Jump to

Keyboard shortcuts

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