// WithField creates an entry from the standard logger and adds a field to
// it. If you want multiple fields, use `WithFields`.
//
// Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal
// or Panic on the LogMsg it returns.
773908
func (logger *Logger) WithField(key string, value interface{}) logging.LogWithLevel {
	return logger.withFields(logging.Fields{key: value}, 1)
}
1216157
func (m Message) FieldsWithOption(optionName string) []*MessageField {
	fields := make([]*MessageField, 0, len(m.Fields))
	for _, field := range m.Fields {
		if _, ok := field.Options[optionName]; ok {
			fields = append(fields, field)
		}
	}
	if len(fields) > 0 {
		return fields
	}
	return nil
}
922932
func (e *Engine) WithLogger(log *zap.Logger) {
	fields := []zap.Field{}
	if e.nodeID != nil {
		fields = append(fields, zap.Int("node_id", *e.nodeID))
	}

	if e.engineID != nil {
		fields = append(fields, zap.Int("engine_id", *e.engineID))
	}
	fields = append(fields, zap.String("service", "storage-engine"))

	e.logger = log.With(fields...)
	e.sfile.WithLogger(e.logger)
	e.index.WithLogger(e.logger)
	e.engine.WithLogger(e.logger)
	e.retentionEnforcer.WithLogger(e.logger)
}
1105590
func WithLogging(logger *log.Logger) SendDecorator {
	return func(s Sender) Sender {
		return SenderFunc(func(r *http.Request) (*http.Response, error) {
			logger.Printf("Sending %s %s", r.Method, r.URL)
			resp, err := s.Do(r)
			if err != nil {
				logger.Printf("%s %s received error '%v'", r.Method, r.URL, err)
			} else {
				logger.Printf("%s %s received %s", r.Method, r.URL, resp.Status)
			}
			return resp, err
		})
	}
}
221531
func (c *causeT) With(keyvals ...interface{}) Error {
	return &causeT{
		errorT: c.errorT.withKeyvals(keyvals),
		cause:  c.cause,
	}
}
9726
func (service *Service) WithLogger(logger LogAdapter) {
	service.Context = WithLogger(service.Context, logger)
}
707598
func FieldWithType(name, t string) *Field {
	return &Field{
		fieldType:      t,
		Widget:         nil,
		name:           name,
		class:          []string{},
		id:             "",
		params:         map[string]interface{}{},
		css:            map[string]string{},
		label:          "",
		labelClass:     []string{},
		tag:            map[string]struct{}{},
		value:          "",
		helptext:       "",
		errors:         []string{},
		additionalData: map[string]interface{}{},
		choices:        nil,
		choiceKeys:     map[string]ChoiceIndex{},
		AppendData:     map[string]interface{}{},
		tmplStyle:      "",
	}
}
1093196
func AddFields(ctx context.Context, fields logrus.Fields) {
	ctxlogrus.AddFields(ctx, fields)
}
89342
func (il IfLogger) With(values ...interface{}) ContextLogger {
	if len(values) == 1 {
		return &contextLogger{isTrue: il.ok(), data: values[0]}
	}
	return &contextLogger{isTrue: il.ok(), data: values}
}
1035209
func (c *CtxDimensions) With(ctx context.Context, log Logger) *Context {
	return NewContext(log).With(c.From(ctx)...)
}
250788
func (entry *Entry) WithFields(fields lg.Fields) *Entry {
	data := make(lg.Fields, len(entry.fields)+len(fields))
	for k, v := range entry.fields {
		data[k] = v
	}
	for k, v := range fields {
		data[k] = v
	}
	return &Entry{logger: entry.logger, fields: data, lgEntry: entry.lgEntry}
}
1131464
func WithLog(e *logrus.Entry) Option {
	return func(opts *options) {
		opts.log = e
	}
}
81125
func (f *BuildField) WithJWG() bool {
	fieldType, err := genbase.ExprToBaseTypeName(f.fieldInfo.Type)
	if err != nil {
		panic(err)
	}
	for _, st := range f.parent.parent.Structs {
		if fieldType == st.Name() {
			return true
		}
	}
	return false
}
1268823
func (builder *SearchCommandBuilder) WithReturnFields(fields ...string) *SearchCommandBuilder {
	builder.protobuf.Fl = make([][]byte, len(fields))
	for i, f := range fields {
		builder.protobuf.Fl[i] = []byte(f)
	}
	return builder
}
668295
func WithLogEntries(msg string, err error, entries map[string][]string) {
	displayError(msg, err)

	for name, lines := range entries {
		console.OutStyle("failure", "Problems detected in %q:", name)
		if len(lines) > MaxLogEntries {
			lines = lines[:MaxLogEntries]
		}
		for _, l := range lines {
			console.OutStyle("log-entry", l)
		}
	}
	os.Exit(Software)
}
1008586
func GetLoggerWithFields(ctx context.Context, fields map[interface{}]interface{}, keys ...interface{}) Logger {
	// must convert from interface{} -> interface{} to string -> interface{} for logrus.
	lfields := make(logrus.Fields, len(fields))
	for key, value := range fields {
		lfields[fmt.Sprint(key)] = value
	}

	return getLogrusLogger(ctx, keys...).WithFields(lfields)
}
208877
func (a *DateHistogramAggregation) Field(field string) *DateHistogramAggregation {
	a.field = field
	return a
}