Documentation ¶
Index ¶
- Variables
- func Color(value ...Attribute) func(io.Writer, ...interface{})
- func New(w io.Writer, l Level, tag string) *logger
- type Attribute
- type Entry
- type Field
- type Fielder
- type FieldsSort
- type Formatter
- type FormatterManager
- type Hook
- type HookFunc
- type Hooks
- type Level
- type Logger
- type Mutex
- type NullFormatter
- type RawFormatter
- type Reader
- type StdLogger
- type StrLogger
- type TextFormatter
- type Timing
- type TmplBase
- type XtrLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var NoColor = !isatty.IsTerminal(os.Stdout.Fd())
Functions ¶
Types ¶
type FieldsSort ¶
type FieldsSort []Field
func (FieldsSort) Len ¶
func (f FieldsSort) Len() int
func (FieldsSort) Less ¶
func (f FieldsSort) Less(i, j int) bool
func (FieldsSort) Swap ¶
func (f FieldsSort) Swap(i, j int)
type Formatter ¶
func DefaultNullFormatter ¶
func DefaultNullFormatter() Formatter
func DefaultRawFormatter ¶
func DefaultRawFormatter() Formatter
func MakeTextFormatter ¶
type FormatterManager ¶
type Mutex ¶
type Mutex interface { Lock() Unlock() }
Package level mutex to prevent interference with other mutexes.
type NullFormatter ¶
type NullFormatter struct{}
type RawFormatter ¶
type RawFormatter struct{}
type StdLogger ¶
type StdLogger interface { Fatal(...interface{}) Fatalf(string, ...interface{}) Fatalln(...interface{}) Panic(...interface{}) Panicf(string, ...interface{}) Panicln(...interface{}) Print(...interface{}) Printf(string, ...interface{}) Println(...interface{}) }
An interface to some methods of the standard library log package.
type StrLogger ¶
type StrLogger interface {
Level() Level
}
A interface to package local structured logging.
type TextFormatter ¶
A text formatter
Uses the package color functions (linux only) and involves a bit of overengineering with text.template where string+" " or fmt.Sprintf would work(this provides multiple templating options to work with in formatting as opposed to appending or formatting by package fmt).
If minimalism is your thing, rewrite this.
Click to show internal directories.
Click to hide internal directories.