Versions in this module Expand all Collapse all v1 v1.0.1 Feb 25, 2021 Changes in this version + const ColorBlack + const ColorBlue + const ColorCyan + const ColorDarkGray + const ColorDefault + const ColorGreen + const ColorHotPink + const ColorLightGray + const ColorMagenta + const ColorOrange + const ColorPurple + const ColorRed + const ColorTurquoise + const ColorWhite + const ColorYellow + const DefaultTraceID + const FontBlink + const FontBold + const FontDefault + const FontItalic + const FontLight + const FontReverse + const FontUnderline + func Debug(ctx context.Context, args ...interface{}) + func Debugf(ctx context.Context, format string, args ...interface{}) + func Debugln(ctx context.Context, args ...interface{}) + func Deepen(ctx context.Context) context.Context + func Error(ctx context.Context, args ...interface{}) + func Errorf(ctx context.Context, format string, args ...interface{}) + func Errorln(ctx context.Context, args ...interface{}) + func Fatal(ctx context.Context, args ...interface{}) + func Fatalf(ctx context.Context, format string, args ...interface{}) + func Fatalln(ctx context.Context, args ...interface{}) + func Info(ctx context.Context, args ...interface{}) + func Infof(ctx context.Context, format string, args ...interface{}) + func Infoln(ctx context.Context, args ...interface{}) + func NewContext(ctx context.Context, l *Logger) context.Context + func Panic(ctx context.Context, args ...interface{}) + func Panicf(ctx context.Context, format string, args ...interface{}) + func Panicln(ctx context.Context, args ...interface{}) + func Prefix() string + func Print(ctx context.Context, args ...interface{}) + func Printf(ctx context.Context, format string, args ...interface{}) + func Println(ctx context.Context, args ...interface{}) + func RawLog(ctx context.Context, level LogLevel, args ...interface{}) + func RawLogf(ctx context.Context, level LogLevel, format string, args ...interface{}) + func RawLogln(ctx context.Context, level LogLevel, args ...interface{}) + func SetFlags(flags int) + func SetLevel(level LogLevel) + func SetLevelColor(level LogLevel, fg, bg ColorCode, font FontCode) + func SetMessageColor(fg, bg ColorCode, font FontCode) + func SetOutput(w io.Writer) + func SetPrefix(prefix string) + func SetSourceColor(fg, bg ColorCode, font FontCode) + func SetSourceFormat(format string) + func SetTimeColor(fg, bg ColorCode, font FontCode) + func SetTimeFormat(timeFormat string) + func SetTimeZone(timeZone *time.Location) + func StackTrace(ctx context.Context) + func TimeFormat() string + func TimeZone() *time.Location + func Trace(ctx context.Context, fnc TraceFunc, args ...interface{}) error + func Tracef(ctx context.Context, fnc TraceFunc, format string, args ...interface{}) error + func Traceln(ctx context.Context, fnc TraceFunc, args ...interface{}) error + func Warn(ctx context.Context, args ...interface{}) + func Warnf(ctx context.Context, format string, args ...interface{}) + func Warnln(ctx context.Context, args ...interface{}) + func Writer() io.Writer + type ColorCode string + type Colorizer struct + func LevelColor(level LogLevel) *Colorizer + func MessageColor() *Colorizer + func NewColorizer(foreground, background ColorCode, font FontCode) (*Colorizer, error) + func SourceColor() *Colorizer + func TimeColor() *Colorizer + func (c *Colorizer) Colorize(message string) string + func (c *Colorizer) GetBackground() ColorCode + func (c *Colorizer) GetFont() FontCode + func (c *Colorizer) GetForeground() ColorCode + func (c *Colorizer) SetBackground(bg ColorCode) error + func (c *Colorizer) SetFont(font FontCode) error + func (c *Colorizer) SetForeground(fg ColorCode) error + type FontCode int + type LogLevel int + const CRITICAL + const DEBUG + const ERROR + const IGNORED + const INFO + const LOG + const NONE + const TRACE + const WARNING + func Level() LogLevel + func (ll *LogLevel) UnmarshalJSON(data []byte) error + func (ll *LogLevel) UnmarshalText(data string) error + func (ll LogLevel) MarshalJSON() ([]byte, error) + func (ll LogLevel) PaddedString(n int) string + func (ll LogLevel) String() string + type Logger struct + func FromContext(ctx context.Context) *Logger + func NewLogger(w io.Writer, level LogLevel) *Logger + func (l *Logger) Clone() *Logger + func (l *Logger) Colorize() + func (l *Logger) Debug(args ...interface{}) + func (l *Logger) Debugf(format string, args ...interface{}) + func (l *Logger) Debugln(args ...interface{}) + func (l *Logger) Error(args ...interface{}) + func (l *Logger) Errorf(format string, args ...interface{}) + func (l *Logger) Errorln(args ...interface{}) + func (l *Logger) Fatal(args ...interface{}) + func (l *Logger) Fatalf(format string, args ...interface{}) + func (l *Logger) Fatalln(args ...interface{}) + func (l *Logger) Info(args ...interface{}) + func (l *Logger) Infof(format string, args ...interface{}) + func (l *Logger) Infoln(args ...interface{}) + func (l *Logger) Level() LogLevel + func (l *Logger) LevelColor(level LogLevel) *Colorizer + func (l *Logger) MakeDefault() + func (l *Logger) MessageColor() *Colorizer + func (l *Logger) Panic(args ...interface{}) + func (l *Logger) Panicf(format string, args ...interface{}) + func (l *Logger) Panicln(args ...interface{}) + func (l *Logger) Prefix() string + func (l *Logger) PrefixColor() *Colorizer + func (l *Logger) Print(args ...interface{}) + func (l *Logger) Printf(format string, args ...interface{}) + func (l *Logger) Println(args ...interface{}) + func (l *Logger) RawLog(ctx context.Context, level LogLevel, args ...interface{}) + func (l *Logger) RawLogf(ctx context.Context, level LogLevel, format string, args ...interface{}) + func (l *Logger) RawLogln(ctx context.Context, level LogLevel, args ...interface{}) + func (l *Logger) RawStackTrace(ctx context.Context, prefix string) + func (l *Logger) RawTrace(ctx context.Context, fnc TraceFunc, msg string) error + func (l *Logger) RawWrite(ctx context.Context, level LogLevel, message string, trace ...string) (int, error) + func (l *Logger) SetFlags(flags int) + func (l *Logger) SetLevel(level LogLevel) + func (l *Logger) SetLevelColor(level LogLevel, fg, bg ColorCode, font FontCode) + func (l *Logger) SetMessageColor(fg, bg ColorCode, font FontCode) + func (l *Logger) SetOutput(w io.Writer) + func (l *Logger) SetPrefix(prefix string) + func (l *Logger) SetPrefixColor(fg, bg ColorCode, font FontCode) + func (l *Logger) SetSourceColor(fg, bg ColorCode, font FontCode) + func (l *Logger) SetSourceFormat(format string) + func (l *Logger) SetTimeColor(fg, bg ColorCode, font FontCode) + func (l *Logger) SetTimeFormat(timeFormat string) + func (l *Logger) SetTimeZone(timeZone *time.Location) + func (l *Logger) SourceColor() *Colorizer + func (l *Logger) SourceFormat() *SourceFormatter + func (l *Logger) StackTrace() + func (l *Logger) TimeColor() *Colorizer + func (l *Logger) TimeFormat() string + func (l *Logger) TimeZone() *time.Location + func (l *Logger) Trace(ctx context.Context, fnc TraceFunc, args ...interface{}) error + func (l *Logger) Tracef(ctx context.Context, fnc TraceFunc, format string, args ...interface{}) error + func (l *Logger) Traceln(ctx context.Context, fnc TraceFunc, args ...interface{}) error + func (l *Logger) Warn(args ...interface{}) + func (l *Logger) Warnf(format string, args ...interface{}) + func (l *Logger) Warnln(args ...interface{}) + func (l *Logger) WithColor() *Logger + func (l *Logger) WithFlags(flags int) *Logger + func (l *Logger) WithLevel(level LogLevel) *Logger + func (l *Logger) WithLevelColor(level LogLevel, fg, bg ColorCode, font FontCode) *Logger + func (l *Logger) WithMessageColor(fg, bg ColorCode, font FontCode) *Logger + func (l *Logger) WithOutput(w io.Writer) *Logger + func (l *Logger) WithPrefix(prefix string) *Logger + func (l *Logger) WithPrefixColor(fg, bg ColorCode, font FontCode) *Logger + func (l *Logger) WithSourceColor(fg, bg ColorCode, font FontCode) *Logger + func (l *Logger) WithSourceFormat(format string) *Logger + func (l *Logger) WithTimeColor(fg, bg ColorCode, font FontCode) *Logger + func (l *Logger) WithTimeFormat(timeFormat string) *Logger + func (l *Logger) WithTimeZone(timeZone *time.Location) *Logger + func (l *Logger) WithoutColor() *Logger + func (l *Logger) Write(data []byte) (int, error) + func (l *Logger) Writer() io.Writer + type SourceFormatter struct + func NewSourceFormatter(layout string) *SourceFormatter + func SourceFormat() *SourceFormatter + func (sf *SourceFormatter) Format(skip int) string + type SourceRecord struct + BasePath string + FileName string + FullPath string + Function string + LineNumber int + PC uintptr + Package string + QualifiedFunction string + Receiver string + func NewSourceRecord(skip int) *SourceRecord + type TraceFunc func(ctx context.Context) error