Documentation ¶
Index ¶
- func Colorize(color uint, message any) string
- func New(options Options) log.Logger
- type Color
- type Formatter
- type Logger
- func (l *Logger) Debug(args ...any)
- func (l *Logger) DebugContext(ctx context.Context, args ...any)
- func (l *Logger) Error(args ...any)
- func (l *Logger) ErrorContext(ctx context.Context, args ...any)
- func (l *Logger) Fatal(args ...any)
- func (l *Logger) FatalContext(ctx context.Context, args ...any)
- func (l *Logger) Info(args ...any)
- func (l *Logger) InfoContext(ctx context.Context, args ...any)
- func (l *Logger) Log(ctx context.Context, level log.Level, args []any)
- func (l *Logger) Panic(args ...any)
- func (l *Logger) PanicContext(ctx context.Context, args ...any)
- func (l *Logger) Trace(args ...any)
- func (l *Logger) TraceContext(ctx context.Context, args ...any)
- func (l *Logger) Warn(args ...any)
- func (l *Logger) WarnContext(ctx context.Context, args ...any)
- func (l *Logger) WithLevel(level log.Level) log.Logger
- func (l *Logger) WithPrefix(prefix string) log.Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Color ¶
type Color uint
A Color type is a color. It can contain one background color, one foreground color and a format, including ideogram related formats.
const ( BoldFm Color = 1 << iota // 1 FaintFm // 2 ItalicFm // 3 UnderlineFm // 4 SlowBlinkFm // 5 RapidBlinkFm // 6 ReverseFm // 7 ConcealFm // 8 CrossedOutFm // 9 FrakturFm // 20 DoublyUnderlineFm // 21 or bold off for some systems FramedFm // 51 EncircledFm // 52 OverlinedFm // 53 InverseFm = ReverseFm // alias to ReverseFm BlinkFm = SlowBlinkFm // alias to SlowBlinkFm HiddenFm = ConcealFm // alias to ConcealFm StrikeThroughFm = CrossedOutFm // alias to CrossedOutFm )
Special formats
const ( BlackFg Color = (iota << shiftFg) | flagFg // 30, 90 RedFg // 31, 91 GreenFg // 32, 92 YellowFg // 33, 93 BlueFg // 34, 94 MagentaFg // 35, 95 CyanFg // 36, 96 WhiteFg // 37, 97 BrightFg Color = ((1 << 3) << shiftFg) | flagFg // -> 90 // BrownFg represents brown foreground color. // // Deprecated: use YellowFg instead, following specifications BrownFg = YellowFg )
Foreground colors and related formats
const ( BlackBg Color = (iota << shiftBg) | flagBg // 40, 100 RedBg // 41, 101 GreenBg // 42, 102 YellowBg // 43, 103 BlueBg // 44, 104 MagentaBg // 45, 105 CyanBg // 46, 106 WhiteBg // 47, 107 BrightBg Color = ((1 << 3) << shiftBg) | flagBg // -> 100 // BrownBg represents brown foreground color. // // Deprecated: use YellowBg instead, following specifications BrownBg = YellowBg )
Background colors and related formats
type Formatter ¶
Click to show internal directories.
Click to hide internal directories.