text_handler

package
v0.0.0-...-714ab49 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2016 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//DefaultTimeStampFormat is the default timestamp format for the Handler
	DefaultTimeStampFormat = "2006-01-02 15:04:05"
	//DefaultMessageWidth is the default message width for the Handler
	DefaultMessageWidth = 50
)

Colors mapping.

View Source
var Strings = [...]string{
	apex.DebugLevel: "DEBUG",
	apex.InfoLevel:  "INFO",
	apex.WarnLevel:  "WARN",
	apex.ErrorLevel: "ERROR",
	apex.FatalLevel: "FATAL",
}

Strings mapping.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	InfoWriter  io.Writer
	ErrorWriter io.Writer
	// contains filtered or unexported fields
}

Handler implementation.

func New

func New(infoWriter, errorWriter io.Writer, timeStampFormat string, messageWidth int) *Handler

New text handler. Empty `timeStampFormat` will default to `DefaultTimeStampFormat`. Zero `messageWidth` will default to `DefaultMessageWidth`

func (*Handler) HandleLog

func (h *Handler) HandleLog(e *apex.Entry) error

HandleLog implements apex.Handler.

Jump to

Keyboard shortcuts

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