func Object(key string, val interface{}) Field {
	return Field{key: key, fieldType: objectType, obj: val}
}
Object constructs a field with the given key and an arbitrary object. It uses
an encoding-appropriate, reflection-based function to lazily serialize nearly
any object into the logging context, but it's relatively slow and
allocation-heavy.

If encoding fails (e.g., trying to serialize a map[int]string to JSON), Object
includes the error message in the final log output.
package zap
import (
	"encoding/base64"
	"fmt"
	"math"
	"time"
)
type fieldType int
const (
	unknownType fieldType = iota
	boolType
	floatType
	intType
	int64Type
	uintType
	uint64Type
	uintptrType
	stringType
	marshalerType
	objectType
	stringerType
	errorType
	skipType
)
type Field struct {
	key       string
	fieldType fieldType
	ival      int64
	str       string
	obj       interface{}
}
func Skip() Field {
	return Field{fieldType: skipType}
}
func Base64(key string, val []byte) Field {
	return String(key, base64.StdEncoding.EncodeToString(val))
}
func Bool(key string, val bool) Field {
	var ival int64
	if val {
		ival = 1
	}
	return Field{key: key, fieldType: boolType, ival: ival}
}
func Float64(key string, val float64) Field {
	return Field{key: key, fieldType: floatType, ival: int64(math.Float64bits(val))}
}
func Int(key string, val int) Field {
	return Field{key: key, fieldType: intType, ival: int64(val)}
}
func Int64(key string, val int64) Field {
	return Field{key: key, fieldType: int64Type, ival: val}
}
func Uint(key string, val uint) Field {
	return Field{key: key, fieldType: uintType, ival: int64(val)}
}
func Uint64(key string, val uint64) Field {
	return Field{key: key, fieldType: uint64Type, ival: int64(val)}
}
func Uintptr(key string, val uintptr) Field {
	return Field{key: key, fieldType: uintptrType, ival: int64(val)}
}
func String(key string, val string) Field {
	return Field{key: key, fieldType: stringType, str: val}
}
func Stringer(key string, val fmt.Stringer) Field {
	return Field{key: key, fieldType: stringerType, obj: val}
}
func Time(key string, val time.Time) Field {
	return Float64(key, timeToSeconds(val))
}
func Error(err error) Field {
	if err == nil {
		return Skip()
	}
	return Field{key: "error", fieldType: errorType, obj: err}
}
func Stack() Field {
	enc := jsonPool.Get().(*jsonEncoder)
	enc.truncate()
	bs := enc.bytes[:cap(enc.bytes)]
	field := String("stacktrace", takeStacktrace(bs, false))
	enc.Free()
	return field
}
func Duration(key string, val time.Duration) Field {
	return Int64(key, int64(val))
}
func Marshaler(key string, val LogMarshaler) Field {
	return Field{key: key, fieldType: marshalerType, obj: val}
}