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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RELPHandler) Log(level slog.Level, message string, data ...slog.Field) error {
|
func (r *RELPHandler) Handle(ctx context.Context, record slog.Record) error {
|
||||||
event := NewEvent(level.String(), message, data)
|
event := NewEvent(record.Level.String(), record.Message, record.Attrs)
|
||||||
select {
|
select {
|
||||||
case r.ch <- event:
|
case r.ch <- event:
|
||||||
return nil // Successfully sent event to channel
|
return nil // Successfully sent event to channel
|
||||||
|
Loading…
Reference in New Issue
Block a user