Versions in this module Expand all Collapse all v0 v0.0.2 Aug 14, 2024 Changes in this version + const DefaultTimeFormat + var CallerKey = "caller" + var ContextKey = contextKey + var ErrInvalidLevel = errors.New("invalid level") + var ErrMissingValue = fmt.Errorf("missing value") + var LevelKey = "level" + var MessageKey = "msg" + var PrefixKey = "prefix" + var TimestampKey = "time" + 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 Log(level Level, msg interface{}, keyvals ...interface{}) + func Logf(level Level, format string, args ...interface{}) + func LongCallerFormatter(file string, line int, _ string) string + func NowUTC(t time.Time) time.Time + func Print(msg interface{}, keyvals ...interface{}) + func Printf(format string, args ...interface{}) + func SetCallerFormatter(f CallerFormatter) + func SetCallerOffset(offset int) + func SetColorProfile(profile termenv.Profile) + 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 SetStyles(s *Styles) + func SetTimeFormat(format string) + func SetTimeFunction(f TimeFunction) + func ShortCallerFormatter(file string, line int, _ 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, error) + 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) Enabled(_ context.Context, level slog.Level) bool + 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) Handle(ctx context.Context, record slog.Record) error + func (l *Logger) Helper() + func (l *Logger) Info(msg interface{}, keyvals ...interface{}) + func (l *Logger) Infof(format string, args ...interface{}) + func (l *Logger) Log(level Level, msg interface{}, keyvals ...interface{}) + func (l *Logger) Logf(level Level, 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) SetColorProfile(profile termenv.Profile) + 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) SetStyles(s *Styles) + 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) WithAttrs(attrs []slog.Attr) slog.Handler + func (l *Logger) WithGroup(name string) slog.Handler + 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 Styles struct + Caller lipgloss.Style + Key lipgloss.Style + Keys map[string]lipgloss.Style + Levels map[Level]lipgloss.Style + Message lipgloss.Style + Prefix lipgloss.Style + Separator lipgloss.Style + Timestamp lipgloss.Style + Value lipgloss.Style + Values map[string]lipgloss.Style + func DefaultStyles() *Styles + type TimeFunction = func(time.Time) time.Time