formatters

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilelineCaller

func FilelineCaller(skip int) (file string, line int)

FilelineCaller returns file and line for caller

func IsTerminal

func IsTerminal(w io.Writer) bool

IsTerminal returns whether is a valid tty for io.Writer

Types

type JSONFormatter

type JSONFormatter struct {
	AppName    string
	TimeFormat string
	// contains filtered or unexported fields
}

JSONFormatter is a json formatter

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(level log.Level, msg string, logger *log.Logger) []byte

Format implements log.Formatter

type TextFormatter

type TextFormatter struct {
	AppName    string
	TimeFormat string
	// contains filtered or unexported fields
}

TextFormatter is a text line formatter

func (*TextFormatter) Format

func (f *TextFormatter) Format(level log.Level, msg string, logger *log.Logger) []byte

Format implements log.Formatter

Jump to

Keyboard shortcuts

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