Add new event creation method to improve logging functionality.

This commit is contained in:
Jeffrey Paul 2024-05-14 04:58:31 -07:00
parent fb4424d69b
commit 1a8b2c3e4e

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"log/slog"
"net" "net"
"net/url" "net/url"
"os" "os"
@ -115,7 +116,7 @@ func (r *RELPHandler) Startup() error {
} }
func (r *RELPHandler) Log(level slog.Level, message string, data ...slog.Field) error { func (r *RELPHandler) Log(level slog.Level, message string, data ...slog.Field) error {
event := simplelog.NewEvent(level.String(), message, data) event := NewEvent(level.String(), message, data)
select { select {
case r.ch <- event: case r.ch <- event:
return nil // Successfully sent event to channel return nil // Successfully sent event to channel