Documentation
¶
Index ¶
- Constants
- Variables
- func AddHook(hook logrus.Hook)
- func Debug(ctx context.Context, args ...any)
- func Debugf(ctx context.Context, format string, args ...any)
- func EnsureTraceID(ctx context.Context) (context.Context, string)
- func Error(ctx context.Context, args ...any)
- func Errorf(ctx context.Context, format string, args ...any)
- func Fatal(ctx context.Context, args ...any)
- func Fatalf(ctx context.Context, format string, args ...any)
- func Info(ctx context.Context, args ...any)
- func Infof(ctx context.Context, format string, args ...any)
- func New(c *config.Config) (func(), error)
- func Panic(ctx context.Context, args ...any)
- func Panicf(ctx context.Context, format string, args ...any)
- func RegisterHookFactory(hookType HookType, factory HookFactory)
- func SetOutput(out io.Writer)
- func SetVersion(v string)
- func Trace(ctx context.Context, args ...any)
- func Tracef(ctx context.Context, format string, args ...any)
- func Warn(ctx context.Context, args ...any)
- func Warnf(ctx context.Context, format string, args ...any)
- func WithFields(ctx context.Context, fields logrus.Fields) *logrus.Entry
- type Desensitizer
- type HookFactory
- type HookType
- type Logger
- func (l *Logger) AddHook(hook logrus.Hook)
- func (l *Logger) Debug(ctx context.Context, args ...any)
- func (l *Logger) Debugf(ctx context.Context, format string, args ...any)
- func (l *Logger) Error(ctx context.Context, args ...any)
- func (l *Logger) Errorf(ctx context.Context, format string, args ...any)
- func (l *Logger) Fatal(ctx context.Context, args ...any)
- func (l *Logger) Fatalf(ctx context.Context, format string, args ...any)
- func (l *Logger) Info(ctx context.Context, args ...any)
- func (l *Logger) Infof(ctx context.Context, format string, args ...any)
- func (l *Logger) Init(c *config.Config) (func(), error)
- func (l *Logger) Panic(ctx context.Context, args ...any)
- func (l *Logger) Panicf(ctx context.Context, format string, args ...any)
- func (l *Logger) SetOutput(out io.Writer)
- func (l *Logger) SetVersion(v string)
- func (l *Logger) Trace(ctx context.Context, args ...any)
- func (l *Logger) Tracef(ctx context.Context, format string, args ...any)
- func (l *Logger) Warn(ctx context.Context, args ...any)
- func (l *Logger) Warnf(ctx context.Context, format string, args ...any)
Constants ¶
const ( VersionKey = "version" SpanTitleKey = "title" SpanFunctionKey = "function" )
Key constants
Variables ¶
var ProviderSet = wire.NewSet(ProvideLogger)
ProviderSet is the wire provider set for the logger package
Functions ¶
func EnsureTraceID ¶
EnsureTraceID ensures that a trace ID exists in the context.
func RegisterHookFactory ¶ added in v0.2.1
func RegisterHookFactory(hookType HookType, factory HookFactory)
RegisterHookFactory registers a hook factory for a given type. This is called by hook packages in their init() functions.
Types ¶
type Desensitizer ¶
type Desensitizer struct {
// contains filtered or unexported fields
}
Desensitizer handles sensitive data masking in log fields
func NewDesensitizer ¶
func NewDesensitizer(cfg *config.Desensitization) *Desensitizer
NewDesensitizer creates a new desensitizer instance
func (*Desensitizer) DeepDesensitize ¶
func (d *Desensitizer) DeepDesensitize(data any) any
DeepDesensitize provides standalone deep desensitization
func (*Desensitizer) DesensitizeFields ¶
func (d *Desensitizer) DesensitizeFields(fields logrus.Fields) logrus.Fields
DesensitizeFields processes log fields and masks sensitive data
type HookFactory ¶ added in v0.2.1
HookFactory creates a logrus hook from configuration
func GetHookFactory ¶ added in v0.2.1
func GetHookFactory(hookType HookType) (HookFactory, bool)
GetHookFactory returns the factory for a given hook type
type HookType ¶ added in v0.2.1
type HookType string
HookType represents the type of logging hook
func GetRegisteredHooks ¶ added in v0.2.1
func GetRegisteredHooks() []HookType
GetRegisteredHooks returns list of registered hook types
type Logger ¶
Logger represents logger instance
func ProvideLogger ¶ added in v0.2.0
ProvideLogger initializes and returns the standard logger
func (*Logger) SetVersion ¶
SetVersion sets the version for logging