Documentation ¶
Index ¶
- type Formatter
- type Level
- type LogEntry
- func (entry *LogEntry) Append(level Level, msg string)
- func (entry *LogEntry) Debug(msg string)
- func (entry *LogEntry) Debugf(msg string, v ...interface{})
- func (entry *LogEntry) Error(msg string)
- func (entry *LogEntry) Errorf(msg string, v ...interface{})
- func (entry *LogEntry) Fatal(msg string)
- func (entry *LogEntry) Fatalf(msg string, v ...interface{})
- func (entry *LogEntry) Important(msg string)
- func (entry *LogEntry) Importantf(msg string, v ...interface{})
- func (entry *LogEntry) Indent()
- func (entry *LogEntry) Info(msg string)
- func (entry *LogEntry) Infof(msg string, v ...interface{})
- func (entry *LogEntry) IsListLogger() bool
- func (entry *LogEntry) Plain(msg string)
- func (entry *LogEntry) Plainf(msg string, v ...interface{})
- func (entry *LogEntry) Plainln()
- func (entry *LogEntry) Render()
- func (entry *LogEntry) SetIndentChar(c string)
- func (entry *LogEntry) SetIndentSize(size int)
- func (entry *LogEntry) SetPrefix(c string)
- func (entry *LogEntry) String() string
- func (entry *LogEntry) Success(msg string)
- func (entry *LogEntry) Successf(msg string, v ...interface{})
- func (entry *LogEntry) Title(title string)
- func (entry *LogEntry) Unindent()
- func (entry *LogEntry) Warning(msg string)
- func (entry *LogEntry) Warningf(msg string, v ...interface{})
- 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) Plain(msg string)
- func (l *Logger) Plainf(msg string, v ...interface{})
- func (l *Logger) Plainln()
- func (l *Logger) SetLevel(level Level)
- 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{})
- type Printer
- type PrinterOptions
- type TextPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Level ¶
type Level int8
Level represents the level of severity.
type LogEntry ¶
type LogEntry struct { Logger *Logger Level Level Message string Entries []LogEntry // contains filtered or unexported fields }
LogEntry represents a single log entry.
func NewListLogger ¶
func NewListLogger() *LogEntry
NewListLogger returns a new entry with `entries` set.
func (*LogEntry) Importantf ¶
Importantf level formatted message.
func (*LogEntry) Indent ¶
func (entry *LogEntry) Indent()
Indent add a string as prefix when indent list entries.
func (*LogEntry) IsListLogger ¶
IsListLogger returns true when ListLogger.
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.
func (*LogEntry) SetPrefix ¶
SetPrefix sets the char used as prefix char for entries. Whitespace as default.
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 sets stdout as printer.
type TextPrinter ¶
type TextPrinter struct { Writer io.Writer Options *PrinterOptions }
TextPrinter sets stdout as printer.
func (*TextPrinter) Format ¶
func (tp *TextPrinter) Format(entry *LogEntry) string
Format defines how the TextPrinter will format a log entry.
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.