func searchJSON(kvs map[string]interface{}, fieldList []string, found func(key string, value interface{}) bool) bool {
	for _, field := range fieldList {
		splits := strings.SplitN(field, ".", 2)
		if len(splits) > 1 {
			name, fieldKey := splits[0], splits[1]
			val, ok := kvs[name]
			if !ok {
				continue
			}
			if m, ok := val.(map[string]interface{}); ok {
				return searchJSON(m, []string{fieldKey}, found)
			}
		} else {
			for k, v := range kvs {
				if field == k && found(k, v) {
					return true
				}
			}
		}
	}
	return false
}
searchJSON searches a document for a key using the found func to determine if the value is accepted.
kvs is the deserialized json document.
fieldList is a list of field names that should be searched. Sub-documents can be searched by using the dot (.). For example, to search {"data"{"message": "<this field>"}} the item would be data.message
package humanlog
import (
	"bytes"
	"encoding/json"
	"fmt"
	"math"
	"sort"
	"strings"
	"text/tabwriter"
	"time"
	"github.com/fatih/color"
)
type JSONHandler struct {
	buf     *bytes.Buffer
	out     *tabwriter.Writer
	truncKV int
	Opts *HandlerOptions
	Level   string
	Time    time.Time
	Message string
	Fields  map[string]string
	last map[string]string
}