Add new event creation method to improve logging functionality.
This commit is contained in:
parent
fb4424d69b
commit
1a8b2c3e4e
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user