Documentation
¶
Index ¶
- Variables
- type Content
- type Entry
- func (entry *Entry) Debug(args ...any)
- func (entry *Entry) Error(args ...any)
- func (entry *Entry) Fatal(args ...any)
- func (entry *Entry) Info(args ...any)
- func (entry *Entry) Log(level Level, args ...any)
- func (entry *Entry) Trace(args ...any)
- func (entry *Entry) Warning(args ...any)
- func (entry *Entry) With(key string, value any) *Entry
- func (entry *Entry) WithContent(content []Content) *Entry
- func (entry *Entry) WithMap(entries Map) *Entry
- type Formatter
- type FormatterJSON
- type FormatterKeyValue
- type Level
- type Logger
- func (logger *Logger) Debug(args ...any)
- func (logger *Logger) Error(args ...any)
- func (logger *Logger) Fatal(args ...any)
- func (logger *Logger) Info(args ...any)
- func (logger *Logger) Log(level Level, args ...any)
- func (logger *Logger) LogEntry(entry *Entry)
- func (logger *Logger) Trace(args ...any)
- func (logger *Logger) Warning(args ...any)
- func (logger *Logger) With(key string, value any) *Entry
- func (logger *Logger) WithContent(content []Content) *Entry
- func (logger *Logger) WithMap(entries Map) *Entry
- type Map
- type Output
- type Printer
- type PrinterStdout
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = NewLoggerDefault()
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { Logger *Logger Content []Content Message string Level Level Time time.Time CallStack []runtime.Frame }
func (*Entry) WithContent ¶
type FormatterJSON ¶
type FormatterJSON struct { FlatContent bool TimeFormat string // contains filtered or unexported fields }
func NewFormatterJSON ¶
func NewFormatterJSON() *FormatterJSON
func (*FormatterJSON) Begin ¶
func (formatter *FormatterJSON) Begin(entry *Entry)
func (*FormatterJSON) End ¶
func (formatter *FormatterJSON) End(_ *Entry) []byte
func (*FormatterJSON) Process ¶
func (formatter *FormatterJSON) Process(entry *Entry)
type FormatterKeyValue ¶
type FormatterKeyValue struct { TimeFormat string // HighPriorityKeys are printed before the actual log message HighPriorityKeys []string // PriorityKeys are printed after the log message PriorityKeys []string // contains filtered or unexported fields }
func NewFormatterKeyValue ¶
func NewFormatterKeyValue() *FormatterKeyValue
func (*FormatterKeyValue) Begin ¶
func (formatter *FormatterKeyValue) Begin(entry *Entry)
func (*FormatterKeyValue) End ¶
func (formatter *FormatterKeyValue) End(_ *Entry) []byte
func (*FormatterKeyValue) Process ¶
func (formatter *FormatterKeyValue) Process(entry *Entry)
type Logger ¶
type Logger struct {
Outputs []*Output
}
func NewLoggerDefault ¶
func NewLoggerDefault() *Logger
func (*Logger) WithContent ¶
type Output ¶
type Output struct { Level Level Formatter Formatter Printer Printer // contains filtered or unexported fields }
func NewOutputDefault ¶
func NewOutputDefault() *Output
type PrinterStdout ¶
type PrinterStdout struct {
// contains filtered or unexported fields
}
func NewPrinterStdout ¶
func NewPrinterStdout() *PrinterStdout
func (*PrinterStdout) Write ¶
func (printer *PrinterStdout) Write(p []byte)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.