Documentation ¶
Overview ¶
The writer package is an event handler responsible for sending events to a generic IO writer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal returns whether the given stream (File) is attached to a TTY.
func NewStandardStreamsHandler ¶
func NewStandardStreamsHandler() *standardStreamsHandler
NewStandardStreamsHandler is a convenience function for constructing a new handler which sends to STDOUT/STDERR. If the output is sent to a TTY, the format is formatter.CONSOLE_COLOR_FORMAT. Otherwise it is formatter.CONSOLE_NOCOLOR_FORMAT. The only difference between the two are the use of color escape codes.
Types ¶
type WriterHandler ¶
WriterHandler is responsible for converting an event into text using a template, and then sending that text to an io.Writer.
func New ¶
func New(output io.Writer, templateString string) (*WriterHandler, error)
New constructs a new WriterHandler handler. templateString must be a template supported by the sawmill/event/formatter package. If the templateString is empty, the WriterHandler will use sawmill/event/formatter.SIMPLE_FORMAT.