Documentation ¶
Index ¶
- Variables
- func Dump(name string, object any)
- func Err(args ...any)
- func Fatal(args ...any)
- func FatalDump(name string, object any)
- func Printf(format string, args ...any)
- func Println(args ...any)
- func Sprint(args ...any) string
- func Sprintf(format string, args ...any) string
- func StartProgressBar(pb *ProgressBar)
- func Warn(args ...any)
- type Category
- type Color
- type Console
- type ConsoleOutput
- func (w *ConsoleOutput) AddLine(l *Line) error
- func (w *ConsoleOutput) AddProgressBar(pb *ProgressBar) error
- func (w *ConsoleOutput) Begin(l *Logger) error
- func (w *ConsoleOutput) End() error
- func (w *ConsoleOutput) Exclude(cat Category) error
- func (w *ConsoleOutput) Include(cat Category) error
- func (w *ConsoleOutput) RemoveProgressBar(pb *ProgressBar) error
- type DirOutput
- type Line
- type Logger
- func (l *Logger) AddOutput(op Output) error
- func (l *Logger) CatPrintf(cat Category, format string, args ...any)
- func (l *Logger) ExcludeConsole(cat Category)
- func (l *Logger) ExcludeDir(cat Category)
- func (l *Logger) GetConsole() *ConsoleOutput
- func (l *Logger) GetDir() *DirOutput
- func (l *Logger) IncludeConsole(cat Category)
- func (l *Logger) IncludeDir(cat Category)
- func (l *Logger) LogLine(ln *Line)
- func (l *Logger) Printf(format string, args ...any)
- func (l *Logger) Println(args ...any)
- func (l *Logger) RemoveProgressBar(pb *ProgressBar) error
- func (l *Logger) StartProgressBar(pb *ProgressBar) error
- type Output
- type ProgressBar
- type ProgressFloat
- type ProgressInt
- type ProgressRange
- type StyleSheet
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultStyleSheet = StyleSheet{ Colors: map[Category]Color{ "debug": White, "warn": Yellow, "error": Red, }, TimeColor: Cyan, BarCaseLeft: '[', BarCaseRight: ']', BarLiquid: '=', BarVoid: ' ', BarHead: []rune{'|', '╱', '─', '╲'}, HeadOscillation: 300 * time.Millisecond, }
View Source
var ErrNoConsole = errors.New("log: no console to use progress bar on")
Functions ¶
func StartProgressBar ¶
func StartProgressBar(pb *ProgressBar)
Types ¶
type Console ¶
type Console interface { Output AddProgressBar(pb *ProgressBar) error RemoveProgressBar(pb *ProgressBar) error }
type ConsoleOutput ¶
type ConsoleOutput struct {
// contains filtered or unexported fields
}
func (*ConsoleOutput) AddLine ¶
func (w *ConsoleOutput) AddLine(l *Line) error
func (*ConsoleOutput) AddProgressBar ¶
func (w *ConsoleOutput) AddProgressBar(pb *ProgressBar) error
func (*ConsoleOutput) Begin ¶
func (w *ConsoleOutput) Begin(l *Logger) error
func (*ConsoleOutput) End ¶
func (w *ConsoleOutput) End() error
func (*ConsoleOutput) Exclude ¶
func (w *ConsoleOutput) Exclude(cat Category) error
func (*ConsoleOutput) Include ¶
func (w *ConsoleOutput) Include(cat Category) error
func (*ConsoleOutput) RemoveProgressBar ¶
func (w *ConsoleOutput) RemoveProgressBar(pb *ProgressBar) error
type Logger ¶
type Logger struct { StyleSheet StyleSheet Outputs []Output }
var DefaultLogger Logger
func (*Logger) ExcludeConsole ¶
func (*Logger) ExcludeDir ¶
func (*Logger) GetConsole ¶
func (l *Logger) GetConsole() *ConsoleOutput
func (*Logger) IncludeConsole ¶
func (*Logger) IncludeDir ¶
func (*Logger) RemoveProgressBar ¶
func (l *Logger) RemoveProgressBar(pb *ProgressBar) error
func (*Logger) StartProgressBar ¶
func (l *Logger) StartProgressBar(pb *ProgressBar) error
type ProgressBar ¶
type ProgressBar struct { Range ProgressRange Title string // contains filtered or unexported fields }
func NewFloatProgressBar ¶
func NewFloatProgressBar(title string, min, max float64) *ProgressBar
func NewIntProgressBar ¶
func NewIntProgressBar(title string, min, max int64) *ProgressBar
func (*ProgressBar) Complete ¶
func (pb *ProgressBar) Complete() error
func (*ProgressBar) SetFloat ¶
func (pb *ProgressBar) SetFloat(f float64)
func (*ProgressBar) SetInt ¶
func (pb *ProgressBar) SetInt(i int64)
type ProgressFloat ¶
type ProgressFloat struct {
// contains filtered or unexported fields
}
func (*ProgressFloat) MinMax ¶
func (pf *ProgressFloat) MinMax() (string, string)
func (*ProgressFloat) PercentValue ¶
func (pf *ProgressFloat) PercentValue() float64
func (*ProgressFloat) SetFloat ¶
func (pf *ProgressFloat) SetFloat(f float64)
func (*ProgressFloat) SetInt ¶
func (pf *ProgressFloat) SetInt(i int64)
func (*ProgressFloat) Value ¶
func (pf *ProgressFloat) Value() string
type ProgressInt ¶
type ProgressInt struct {
// contains filtered or unexported fields
}
func (*ProgressInt) MinMax ¶
func (pi *ProgressInt) MinMax() (string, string)
func (*ProgressInt) PercentValue ¶
func (pi *ProgressInt) PercentValue() float64
func (*ProgressInt) SetFloat ¶
func (pi *ProgressInt) SetFloat(f float64)
func (*ProgressInt) SetInt ¶
func (pi *ProgressInt) SetInt(i int64)
func (*ProgressInt) Value ¶
func (pi *ProgressInt) Value() string
type ProgressRange ¶
type StyleSheet ¶
Click to show internal directories.
Click to hide internal directories.