log_ecslogs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLevel = ecslogs.INFO
)

Variables

This section is empty.

Functions

func New

func New(out io.Writer, prefix string, flags int) *log.Logger

func NewOutput

func NewOutput(out io.Writer, prefix string, flags int) io.Writer

func NewOutputWithLevel

func NewOutputWithLevel(level ecslogs.Level, out io.Writer, prefix string, flags int) io.Writer

func NewWithLevel

func NewWithLevel(level ecslogs.Level, out io.Writer, prefix string, flags int) *log.Logger

func NewWriter

func NewWriter(prefix string, flags int, handler Handler) io.Writer

func TimeFormat

func TimeFormat(flags int) string

Types

type Entry

type Entry struct {
	Prefix  string
	Message string
	File    string
	Line    int
	Time    time.Time
}

func ParseEntry

func ParseEntry(s string, prefix string, flags int) (entry Entry, err error)

func ParseEntryLogger

func ParseEntryLogger(s string, logger *log.Logger) (entry Entry, err error)

type Handler

type Handler interface {
	HandleEntry(Entry) error
}

func NewHandler

func NewHandler(out io.Writer) Handler

func NewHandlerWithLevel

func NewHandlerWithLevel(level ecslogs.Level, out io.Writer) Handler

type HandlerFunc

type HandlerFunc func(Entry) error

func (HandlerFunc) HandleEntry

func (h HandlerFunc) HandleEntry(entry Entry) error

Jump to

Keyboard shortcuts

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