Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithLoggerContext ¶
func WithLoggerContext(l Logger) contextx.WithContext
Types ¶
type Level ¶
type Level uint32
Level type
const ( // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel Level = iota // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel )
func ParseLevel ¶
ParseLevel takes a string level and returns the Logrus log level constant.
func (Level) MarshalText ¶
func (*Level) UnmarshalText ¶
type Logger ¶
type Logger interface {
// Start to start span for tracing
//
// ctx log = log.Start(ctx, "SpanName")
// defer log.End()
//
Start(context.Context, string, ...any) (context.Context, Logger)
// End to end span
End()
// WithValues key value pairs
WithValues(keyAndValues ...interface{}) Logger
Debug(msg string, args ...interface{})
Info(msg string, args ...interface{})
Warn(err error)
Error(err error)
}
func FromContext ¶
Click to show internal directories.
Click to hide internal directories.