func Example_multipleFields() {
	log.WithFields(log.Fields{
		"user": "Tobi",
		"file": "sloth.png",
		"type": "image/png",
	}).Info("upload")
}
Multiple fields can be set, via chaining, or WithFields().
package log_test
import (
	"errors"
	"testing"
	"github.com/apex/log"
	"github.com/apex/log/handlers/memory"
	"github.com/stretchr/testify/assert"
)
type Pet struct {
	Name string
	Age  int
}
func (p *Pet) Fields() log.Fields {
	return log.Fields{
		"name": p.Name,
		"age":  p.Age,
	}
}
func TestInfo(t *testing.T) {
	h := memory.New()
	log.SetHandler(h)
	log.Infof("logged in %s", "Tobi")
	e := h.Entries[0]
	assert.Equal(t, e.Message, "logged in Tobi")
	assert.Equal(t, e.Level, log.InfoLevel)
}
func TestFielder(t *testing.T) {
	h := memory.New()
	log.SetHandler(h)
	pet := &Pet{"Tobi", 3}
	log.WithFields(pet).Info("add pet")
	e := h.Entries[0]
	assert.Equal(t, log.Fields{"name": "Tobi", "age": 3}, e.Fields)
}
func Example_unstructured() {
	log.Infof("%s logged in", "Tobi")
}
func Example_structured() {
	log.WithField("user", "Tobo").Info("logged in")
}
func Example_errors() {
	err := errors.New("boom")
	log.WithError(err).Error("upload failed")
}