upstream sync
This commit is contained in:
22
services/location/mapbox_lib/logger.go
Normal file
22
services/location/mapbox_lib/logger.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user