func (minMaxConstr *minMaxConstraints) IsAllowed(level LogLevel) bool {
	return level >= minMaxConstr.min && level <= minMaxConstr.max
}
IsAllowed returns true, if log level is in [min, max] range (inclusive).
package seelog
import (
	"errors"
	"fmt"
	"strings"
)
type logLevelConstraints interface {
	IsAllowed(level LogLevel) bool
}
type minMaxConstraints struct {
	min LogLevel
	max LogLevel
}
func newMinMaxConstraints(min LogLevel, max LogLevel) (*minMaxConstraints, error) {
	if min > max {
		return nil, errors.New(fmt.Sprintf("Min level can't be greater than max. Got min: %d, max: %d", min, max))
	}
	if min < TraceLvl || min > CriticalLvl {
		return nil, errors.New(fmt.Sprintf("Min level can't be less than Trace or greater than Critical. Got min: %d", min))
	}
	if max < TraceLvl || max > CriticalLvl {
		return nil, errors.New(fmt.Sprintf("Max level can't be less than Trace or greater than Critical. Got max: %d", max))
	}
	return &minMaxConstraints{min, max}, nil
}