Refactored Log method to Handle method for processing records in RELPHandler.

This commit is contained in:
Jeffrey Paul 2024-05-14 04:58:39 -07:00
parent 1a8b2c3e4e
commit 97f466e03f
1 changed files with 2 additions and 2 deletions

View File

@ -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