Documentation ¶
Overview ¶
Package logrus provides a slog.Logger using github.com/sirupsen/logrus Logger as backend
Index ¶
- Constants
- func New(logger *logrus.Logger) slog.Logger
- type Logger
- func (rl *Logger) Debug() slog.Logger
- func (rl *Logger) Enabled() bool
- func (rl *Logger) Error() slog.Logger
- func (rl *Logger) Fatal() slog.Logger
- func (rl *Logger) Info() slog.Logger
- func (rl *Logger) Panic() slog.Logger
- func (rl *Logger) Print(args ...any)
- func (rl *Logger) Printf(format string, args ...any)
- func (rl *Logger) Println(args ...any)
- func (rl *Logger) Warn() slog.Logger
- func (rl *Logger) WithEnabled() (slog.Logger, bool)
- func (rl *Logger) WithField(label string, value any) slog.Logger
- func (rl *Logger) WithFields(fields map[string]any) slog.Logger
- func (rl *Logger) WithLevel(level slog.LogLevel) slog.Logger
- func (rl *Logger) WithStack(skip int) slog.Logger
Constants ¶
View Source
const ( // CallerFieldName is the field name to be used by WithStack() // attempting to mimick the effect of logrus' own SetReportCaller() CallerFieldName = "method" // StackFieldName is the field name used to store the formatted callstack StackFieldName = "call-stack" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is an adaptor for using github.com/sirupsen/logrus as slog.Logger
func (*Logger) Println ¶
Println adds a log entry with arguments handled in the manner of fmt.Println
func (*Logger) WithEnabled ¶
WithEnabled tells if the logger would log or not
func (*Logger) WithFields ¶
WithFields adds fields to the log entry
Click to show internal directories.
Click to hide internal directories.