Documentation
¶
Overview ¶
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Package logger ...
Index ¶
- type Formatter
- type LogEntry
- func (item *LogEntry) Append(level LogLevel, msg string)
- func (item *LogEntry) Debug(msg string)
- func (item *LogEntry) Debugf(msg string, v ...interface{})
- func (item *LogEntry) Error(msg string)
- func (item *LogEntry) Errorf(msg string, v ...interface{})
- func (item *LogEntry) Fatal(msg string)
- func (item *LogEntry) Fatalf(msg string, v ...interface{})
- func (item *LogEntry) Important(msg string)
- func (item *LogEntry) Importantf(msg string, v ...interface{})
- func (item *LogEntry) Indent()
- func (item *LogEntry) Info(msg string)
- func (item *LogEntry) Infof(msg string, v ...interface{})
- func (item *LogEntry) SetIndentChar(c string)
- func (item *LogEntry) SetIndentSize(size int)
- func (item *LogEntry) String() string
- func (item *LogEntry) Success(msg string)
- func (item *LogEntry) Successf(msg string, v ...interface{})
- func (item *LogEntry) Unindent()
- func (item *LogEntry) Warning(msg string)
- func (item *LogEntry) Warningf(msg string, v ...interface{})
- func (item *LogEntry) WithList() *LogEntry
- type LogLevel
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) Debugf(msg string, v ...interface{})
- func (l *Logger) Error(msg string)
- func (l *Logger) Errorf(msg string, v ...interface{})
- func (l *Logger) Fatal(msg string)
- func (l *Logger) Fatalf(msg string, v ...interface{})
- func (l *Logger) Important(msg string)
- func (l *Logger) Importantf(msg string, v ...interface{})
- func (l *Logger) Info(msg string)
- func (l *Logger) Infof(msg string, v ...interface{})
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) SetPrinter(printer Printer)
- func (l *Logger) Success(msg string)
- func (l *Logger) Successf(msg string, v ...interface{})
- func (l *Logger) Warning(msg string)
- func (l *Logger) Warningf(msg string, v ...interface{})
- func (l *Logger) WithList() *LogEntry
- type Printer
- type PrinterOptions
- type TextPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogEntry ¶
type LogEntry struct { Logger *Logger Level LogLevel Message string Entries []LogEntry // contains filtered or unexported fields }
LogEntry represents a single log entry.
func (*LogEntry) Importantf ¶
Importantf level formatted message.
func (*LogEntry) Indent ¶
func (item *LogEntry) Indent()
Indent add a string as prefix when indent list entries.
func (*LogEntry) SetIndentChar ¶
SetIndentChar sets the char used as prefix when indent list entries. Whitespace as default.
func (*LogEntry) SetIndentSize ¶
SetIndentSize sets how many time the indent char has to be repeated when indent list entries.
type LogLevel ¶
type LogLevel int
LogLevel represents the level of severity.
type Logger ¶
Logger represents a logger with configurable Printer and Level.
func (*Logger) Importantf ¶
Importantf level formatted message.
func (*Logger) SetPrinter ¶
SetPrinter set the logger Printer.
type Printer ¶
type Printer interface { Print(string) SetPrinterOptions(options *PrinterOptions) Formatter }
Printer is the interface defining the methods to be implemented by a printer.
type PrinterOptions ¶
type PrinterOptions struct { Timestamp bool TimestampFormat string Colors bool Labels bool Icons bool }
PrinterOptions represents the valid options for a printer.
type TextPrinter ¶
type TextPrinter struct {
Options *PrinterOptions
}
TextPrinter sets stdout as printer.
func (*TextPrinter) Format ¶
func (tp *TextPrinter) Format(item *LogEntry, isWithList bool) string
Format defines how a single log entry will be formatted by the TextLogger printer.
func (*TextPrinter) FormatList ¶
func (tp *TextPrinter) FormatList(item *LogEntry) string
FormatList defines how a log entry with List will be formatted by the TextLogger printer.
func (*TextPrinter) Print ¶
func (tp *TextPrinter) Print(msg string)
Print send the message string to the stdout.
func (*TextPrinter) SetPrinterOptions ¶
func (tp *TextPrinter) SetPrinterOptions(options *PrinterOptions)
SetPrinterOptions sets the printer options for TextPrinter.