Versions in this module Expand all Collapse all v0 v0.2.3 Aug 15, 2023 Changes in this version + const DefaultTimeFormat + var CallerKey = "caller" + var CallerStyle = lipgloss.NewStyle().Faint(true) + var ContextKey = contextKey + var DebugLevelStyle = ...(lipgloss.AdaptiveColor{ ... }) + var ErrMissingValue = fmt.Errorf("missing value") + var ErrorLevelStyle = ...(lipgloss.AdaptiveColor{ ... }) + var FatalLevelStyle = ...(lipgloss.AdaptiveColor{ ... }) + var InfoLevelStyle = ...(lipgloss.AdaptiveColor{ ... }) + var KeyStyle = lipgloss.NewStyle().Faint(true) + var KeyStyles = map[string]lipgloss.Style + var LevelKey = "lvl" + var MessageKey = "msg" + var MessageStyle = lipgloss.NewStyle() + var PrefixKey = "prefix" + var PrefixStyle = lipgloss.NewStyle().Bold(true).Faint(true) + var SeparatorStyle = lipgloss.NewStyle().Faint(true) + var TimestampKey = "ts" + var TimestampStyle = lipgloss.NewStyle() + var ValueStyle = lipgloss.NewStyle() + var ValueStyles = map[string]lipgloss.Style + var WarnLevelStyle = ...(lipgloss.AdaptiveColor{ ... }) + func Debug(msg interface{}, keyvals ...interface{}) + func Debugf(format string, args ...interface{}) + func Error(msg interface{}, keyvals ...interface{}) + func Errorf(format string, args ...interface{}) + func Fatal(msg interface{}, keyvals ...interface{}) + func Fatalf(format string, args ...interface{}) + func GetPrefix() string + func Helper() + func Info(msg interface{}, keyvals ...interface{}) + func Infof(format string, args ...interface{}) + func LongCallerFormatter(file string, line int, funcName string) string + func NowUTC() time.Time + func Print(msg interface{}, keyvals ...interface{}) + func Printf(format string, args ...interface{}) + func SetCallerFormatter(f CallerFormatter) + func SetCallerOffset(offset int) + func SetDefault(logger *Logger) + func SetFormatter(f Formatter) + func SetLevel(level Level) + func SetOutput(w io.Writer) + func SetPrefix(prefix string) + func SetReportCaller(report bool) + func SetReportTimestamp(report bool) + func SetTimeFormat(format string) + func SetTimeFunction(f TimeFunction) + func ShortCallerFormatter(file string, line int, funcName string) string + func StandardLog(opts ...StandardLogOptions) *log.Logger + func Warn(msg interface{}, keyvals ...interface{}) + func Warnf(format string, args ...interface{}) + func WithContext(ctx context.Context, logger *Logger) context.Context + type CallerFormatter func(string, int, string) string + type Formatter uint8 + const JSONFormatter + const LogfmtFormatter + const TextFormatter + type Level int32 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const WarnLevel + func GetLevel() Level + func ParseLevel(level string) Level + func (l Level) String() string + type Logger struct + func Default() *Logger + func FromContext(ctx context.Context) *Logger + func New(w io.Writer) *Logger + func NewWithOptions(w io.Writer, o Options) *Logger + func With(keyvals ...interface{}) *Logger + func WithPrefix(prefix string) *Logger + func (l *Logger) Debug(msg interface{}, keyvals ...interface{}) + func (l *Logger) Debugf(format string, args ...interface{}) + func (l *Logger) Error(msg interface{}, keyvals ...interface{}) + func (l *Logger) Errorf(format string, args ...interface{}) + func (l *Logger) Fatal(msg interface{}, keyvals ...interface{}) + func (l *Logger) Fatalf(format string, args ...interface{}) + func (l *Logger) GetLevel() Level + func (l *Logger) GetPrefix() string + func (l *Logger) Helper(skip ...int) + func (l *Logger) Info(msg interface{}, keyvals ...interface{}) + func (l *Logger) Infof(format string, args ...interface{}) + func (l *Logger) Print(msg interface{}, keyvals ...interface{}) + func (l *Logger) Printf(format string, args ...interface{}) + func (l *Logger) SetCallerFormatter(f CallerFormatter) + func (l *Logger) SetCallerOffset(offset int) + func (l *Logger) SetFormatter(f Formatter) + func (l *Logger) SetLevel(level Level) + func (l *Logger) SetOutput(w io.Writer) + func (l *Logger) SetPrefix(prefix string) + func (l *Logger) SetReportCaller(report bool) + func (l *Logger) SetReportTimestamp(report bool) + func (l *Logger) SetTimeFormat(format string) + func (l *Logger) SetTimeFunction(f TimeFunction) + func (l *Logger) StandardLog(opts ...StandardLogOptions) *log.Logger + func (l *Logger) Warn(msg interface{}, keyvals ...interface{}) + func (l *Logger) Warnf(format string, args ...interface{}) + func (l *Logger) With(keyvals ...interface{}) *Logger + func (l *Logger) WithPrefix(prefix string) *Logger + type LoggerOption = func(*Logger) + type Options struct + CallerFormatter CallerFormatter + CallerOffset int + Fields []interface{} + Formatter Formatter + Level Level + Prefix string + ReportCaller bool + ReportTimestamp bool + TimeFormat string + TimeFunction TimeFunction + type StandardLogOptions struct + ForceLevel Level + type TimeFunction = func() time.Time