Documentation ¶
Overview ¶
Package log provides debug logging
Index ¶
- Variables
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Name(name string)
- func SetLevel(l Level)
- func SetPrefix(p string)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- func WithLevel(l Level, v ...interface{})
- func WithLevelf(l Level, format string, v ...interface{})
- type Level
- type Log
- type Option
- type Options
- type ReadOption
- type ReadOptions
- type Record
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultLog logger DefaultLog = NewLog() // DefaultLevel is default log level DefaultLevel = LevelInfo )
View Source
var (
// DefaultSize of the logger buffer
DefaultSize = 1000
)
Functions ¶
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf logs with Logf and then exits with os.Exit(1)
func WithLevelf ¶
WithLevel logs with the level specified
Types ¶
type Log ¶
type Log interface { // Read reads log entries from the logger Read(...ReadOption) []Record // Write writes records to log Write(Record) // Stream log records Stream(chan bool) <-chan Record }
Log is event log
type Options ¶
type Options struct { // 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
Click to show internal directories.
Click to hide internal directories.