Documentation
¶
Overview ¶
Package log provides debug logging
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default buffer size if any. DefaultSize = 1024 // DefaultLog logger. DefaultLog = NewLog() // Default formatter. DefaultFormat = TextFormat )
Functions ¶
Types ¶
type FormatFunc ¶
Format is a function which formats the output.
type Log ¶
type Log interface {
// Read reads log entries from the logger
Read(...ReadOption) ([]Record, error)
// Write writes records to log
Write(Record) error
// Stream log records
Stream() (Stream, error)
}
Log is debug log interface for reading and writing logs.
type Option ¶
type Option func(*Options)
Option used by the logger.
func Format ¶
func Format(f FormatFunc) Option
type Options ¶
type Options struct {
// Format specifies the output format
Format FormatFunc
// Name of the log
Name string
// Size is the size of ring buffer
Size int
}
Options are logger options.
type ReadOption ¶
type ReadOption func(*ReadOptions)
ReadOption used for reading the logs.
func Since ¶
func Since(s time.Time) ReadOption
Since sets the time since which to return the log records.
type ReadOptions ¶
type ReadOptions struct {
// Since what time in past to return the logs
Since time.Time
// Count specifies number of logs to return
Count int
// Stream requests continuous log stream
Stream bool
}
ReadOptions for querying the logs.
Source Files
¶
- log.go
- options.go
- os.go
Click to show internal directories.
Click to hide internal directories.