diff --git a/go.mod b/go.mod index 55d2b76..03d4013 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/alexandrevicenzi/go-sse -go 1.11 +go 1.18 diff --git a/options.go b/options.go index fe67dc8..534749e 100644 --- a/options.go +++ b/options.go @@ -1,10 +1,16 @@ package sse import ( - "log" "net/http" ) +// Logger Interface with all necessary functions to log. +type LogPrinter interface { + Print(v ...any) + Println(v ...any) + Printf(format string, v ...any) +} + // Options holds server configurations. type Options struct { // RetryInterval change EventSource default retry interval (milliseconds). @@ -15,7 +21,7 @@ type Options struct { // Default channel name is the request path. ChannelNameFunc func(*http.Request) string // All usage logs end up in Logger - Logger *log.Logger + Logger LogPrinter } func (opt *Options) hasHeaders() bool {