// Format writes the log entry message to the provided writer.
345822
func (m MessageFormatter) Format(w io.Writer, entry zapcore.Entry, fields []zapcore.Field) {
	fmt.Fprintf(w, m.FormatVerb, strings.TrimRight(entry.Message, "\n"))
}
1289787
func (a *BucketScriptAggregation) Format(format string) *BucketScriptAggregation {
	a.format = format
	return a
}
967243
func (a *CompositeAggregationDateHistogramValuesSource) Format(format string) *CompositeAggregationDateHistogramValuesSource {
	a.format = format
	return a
}
179713
func (m MsgPack) Format(b []byte, l *Logger, t time.Time, severity int, msg string,
	fields map[string]interface{}) ([]byte, error) {
	b = append(b, byte(mpFixArray+3))
	b, err := appendMsgpack(b, l.Topic())
	if err != nil {
		return nil, err
	}
	b, err = appendMsgpack(b, t.Unix())
	if err != nil {
		return nil, err
	}

	// the log record consists of these objects:
	//     logged_at, severity, utsname, message, objects in fields,
	//     and objects in l.defaults excluding conflicting keys.
	var nFields uint64
	nFields += 4
	for k := range fields {
		if !ReservedKey(k) {
			nFields++
		}
	}
	for k := range l.Defaults() {
		if ReservedKey(k) {
			continue
		}
		if _, ok := fields[k]; ok {
			continue
		}
		nFields++
	}
	if nFields > math.MaxUint16 {
		return nil, ErrTooLarge
	}

	if nFields <= 15 {
		b = append(b, byte(mpFixMap+nFields))
	} else {
		b = append(b, byte(mpMap16), 0, 0)
		binary.BigEndian.PutUint16(b[len(b)-2:], uint16(nFields))
	}

	// logged_at
	b, err = appendMsgpack(b, FnLoggedAt)
	if err != nil {
		return nil, err
	}
	b, err = appendMsgpack(b, t.UnixNano()/1000)
	if err != nil {
		return nil, err
	}

	// severity
	b, err = appendMsgpack(b, FnSeverity)
	if err != nil {
		return nil, err
	}
	b, err = appendMsgpack(b, severity)
	if err != nil {
		return nil, err
	}

	// utsname
	b, err = appendMsgpack(b, FnUtsname)
	if err != nil {
		return nil, err
	}
	if len(m.Utsname) > 0 {
		b, err = appendMsgpack(b, m.Utsname)
	} else {
		b, err = appendMsgpack(b, utsname)
	}
	if err != nil {
		return nil, err
	}

	b, err = appendMsgpack(b, FnMessage)
	if err != nil {
		return nil, err
	}
	// message
	if len(b)+len(msg) > maxLogSize {
		return nil, ErrTooLarge
	}
	b, err = appendMsgpack(b, msg)
	if err != nil {
		return nil, err
	}

	// fields
	for k, v := range fields {
		if ReservedKey(k) {
			continue
		}
		if len(b)+len(k) > maxLogSize {
			return nil, ErrTooLarge
		}
		b, err = appendMsgpack(b, k)
		if err != nil {
			return nil, err
		}

		b, err = appendMsgpack(b, v)
		if err != nil {
			return nil, err
		}
	}

	// defaults
	for k, v := range l.Defaults() {
		if ReservedKey(k) {
			continue
		}
		if _, ok := fields[k]; ok {
			continue
		}
		if len(b)+len(k) > maxLogSize {
			return nil, ErrTooLarge
		}
		b, err = appendMsgpack(b, k)
		if err != nil {
			return nil, err
		}

		b, err = appendMsgpack(b, v)
		if err != nil {
			return nil, err
		}
	}

	return b, nil
}
819165
func (af azureFormatter) Format(event *contract.Event) []byte {
	am, err := newAzureMessage()
	if err != nil {
		LoggingClient.Error(fmt.Sprintf("Error creating a new Azure message: %s", err))
		return []byte{}
	}
	am.ConnDevID = event.Device
	am.UserID = string(event.Origin)
	data, err := json.Marshal(event)
	if err != nil {
		LoggingClient.Error(fmt.Sprintf("Error parsing Event data: %s", err))
		return []byte{}
	}
	am.Body = data
	msg, err := json.Marshal(am)
	if err != nil {
		LoggingClient.Error(fmt.Sprintf("Error parsing AzureMessage data: %s", err))
		return []byte{}
	}
	return msg
}
690765
func (_ *NilFormatter) Format(_ string, _ LogLevel, _ int, _ ...interface{}) {
	// noop
}
1117649
func Format(record []string) string {
	buffer := bytes.NewBufferString("")
	writer := csv.NewWriter(buffer)
	writer.Write(record)
	writer.Flush()
	return strings.TrimRight(buffer.String(), "\n")
}
198908
func (node *When) Format(buf *TrackedBuffer) {
	buf.Myprintf("when %v then %v", node.Cond, node.Val)
}
888244
func (p *PercentilesBucketAggregation) Format(format string) *PercentilesBucketAggregation {
	p.format = format
	return p
}
874183
func (a *BucketSelectorAggregation) Format(format string) *BucketSelectorAggregation {
	a.format = format
	return a
}
1360920
func (c ColorFormatter) Format(w io.Writer, entry zapcore.Entry, fields []zapcore.Field) {
	switch {
	case c.Reset:
		fmt.Fprintf(w, ResetColor())
	case c.Bold:
		fmt.Fprintf(w, c.LevelColor(entry.Level).Bold())
	default:
		fmt.Fprintf(w, c.LevelColor(entry.Level).Normal())
	}
}
886609
func (a *MovAvgAggregation) Format(format string) *MovAvgAggregation {
	a.format = format
	return a
}
452472
func Format(t string) (ReadWriteFormatter, error) {
	formatter, ok := formatters[t]
	if !ok {
		return &JSONFormatter{}, ErrNotSuppoted
	}

	return formatter, nil
}
1014257
func (a *DerivativeAggregation) Format(format string) *DerivativeAggregation {
	a.format = format
	return a
}
1154124
func (e Error) Format(a ...interface{}) Error {
	e.Message = fmt.Sprintf(e.Message, a...)
	return e
}
1274096
func (e *merryErr) Format(s fmt.State, verb rune) {
	switch verb {
	case 'v':
		if s.Flag('+') {
			io.WriteString(s, Details(e))
			return
		}
		fallthrough
	case 's':
		io.WriteString(s, e.Error())
	case 'q':
		fmt.Fprintf(s, "%q", e.Error())
	}
}
470125
func (h Hash) Format(s fmt.State, c rune) {
	fmt.Fprintf(s, "%"+string(c), h[:])
}