log/filtered/filtered.go
func MapFilter(filter Filter) Filter {
	return FilterFunc(func(k string, v interface{}) interface{} {
		r := reflect.ValueOf(v)
		if r.Kind() == reflect.Map {
			// res will be the filtered map
			res := make(map[string]interface{}, r.Len())
			for _, key := range r.MapKeys() {
				str := key.String()
				val := r.MapIndex(key).Interface()
				res[str] = filter.Filter(str, val)
			}

			return res
		}

		return v
	})
}
func MapFilter(filter Filter) Filter {
	return FilterFunc(func(k string, v interface{}) interface{} {
		r := reflect.ValueOf(v)
		if r.Kind() == reflect.Map {
			// res will be the filtered map
			res := make(map[string]interface{}, r.Len())
			for _, key := range r.MapKeys() {
				str := key.String()
				val := r.MapIndex(key).Interface()
				res[str] = filter.Filter(str, val)
			}

			return res
		}

		return v
	})
}
// MapFilter lifts the filter to also work on maps. It loses the type
// information of the map fields