Refactored Log method to Handle method for processing records in RELPHandler.
This commit is contained in:
parent
1a8b2c3e4e
commit
97f466e03f
@ -115,8 +115,8 @@ func (r *RELPHandler) Startup() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *RELPHandler) Log(level slog.Level, message string, data ...slog.Field) error {
|
||||
event := NewEvent(level.String(), message, data)
|
||||
func (r *RELPHandler) Handle(ctx context.Context, record slog.Record) error {
|
||||
event := NewEvent(record.Level.String(), record.Message, record.Attrs)
|
||||
select {
|
||||
case r.ch <- event:
|
||||
return nil // Successfully sent event to channel
|
||||
|
Loading…
Reference in New Issue
Block a user