File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,15 @@ type Options struct {
69
69
Debug bool
70
70
}
71
71
72
+ // Logger generic interface for logger
73
+ type Logger interface {
74
+ Printf (string , ... interface {})
75
+ }
76
+
72
77
// Cors http handler
73
78
type Cors struct {
74
79
// Debug logger
75
- Log * log. Logger
80
+ Log Logger
76
81
// Normalized list of plain allowed origins
77
82
allowedOrigins []string
78
83
// List of allowed origins containing wildcards
@@ -349,7 +354,7 @@ func (c *Cors) handleActualRequest(w http.ResponseWriter, r *http.Request) {
349
354
c .logf (" Actual response added headers: %v" , headers )
350
355
}
351
356
352
- // convenience method. checks if debugging is turned on before printing
357
+ // convenience method. checks if a logger is set.
353
358
func (c * Cors ) logf (format string , a ... interface {}) {
354
359
if c .Log != nil {
355
360
c .Log .Printf (format , a ... )
You can’t perform that action at this time.
0 commit comments