Files
old-backend/services/location/mapbox_lib/logger.go
2023-10-12 05:23:34 +02:00

22 lines
385 B
Go

package mapbox
import (
"context"
)
type Logger interface {
Debugf(msg string, params ...interface{})
Errorf(msg string, params ...interface{})
}
// withLogger helps to reduce unnecessary allocations
func (c *config) withLogger(ctx context.Context, do func(Logger)) {
if c.requestLogger != nil {
do(c.requestLogger(ctx))
return
}
if c.logger != nil {
do(c.logger)
}
}