func (l *ZapAdapter) WithData(data lager.Data) lager.Logger {
	logger := &ZapAdapter{
		sessionID:  l.sessionID,
		origLogger: l.origLogger,
		Logger:     l.origLogger.With(dataToFields(data)...),
		context:    l.context,
	}
	return logger
}
WithData returns a new logger with specified data fields set.
package lager
import (
	"fmt"
	"code.cloudfoundry.org/lager"
	"go.uber.org/zap"
)
var _ lager.Logger = &ZapAdapter{}
type ZapAdapter struct {
	sessionID string
	*zap.Logger
	origLogger *zap.Logger
	context    []zap.Field
}
func dataToFields(data ...lager.Data) (fields []zap.Field) {
	for _, d := range data {
		for k, v := range d {
			fields = append(fields, zap.Any(k, v))
		}
	}
	return fields
}
func NewZapAdapter(component string, zapLogger *zap.Logger) *ZapAdapter {
	logger := zapLogger.Named(component)
	return &ZapAdapter{
		sessionID:  component,
		Logger:     logger,
		origLogger: logger,
	}
}
func (l *ZapAdapter) RegisterSink(_ lager.Sink) {}
func (l *ZapAdapter) Session(task string, data ...lager.Data) lager.Logger {
	newSession := fmt.Sprintf("%s.%s", l.sessionID, task)
	logger := &ZapAdapter{
		sessionID:  newSession,
		origLogger: l.origLogger,
		Logger:     l.origLogger.Named(task),
		context:    append(l.context, dataToFields(data...)...),
	}
	return logger
}
func (l *ZapAdapter) SessionName() string {
	return l.sessionID
}