class LogValidator implements AnnotationUsageValidator<T> {

    @Override
    public void validate(Method method, T target) throws AnnotationUsageException {
        LogLevel expectedLevel = AnnotationAttribute.LEVEL.extract(target);
        LogLevel ifEnabledLevel = AnnotationAttribute.IF_ENABLED.extract(target);
        if (ifEnabledLevel.ordinal() >= expectedLevel.ordinal() && ifEnabledLevel != OFF) {
            throw new AnnotationUsageException(method,
                    format("'ifEnabled = %s' should be more strict than 'level = %s'", ifEnabledLevel, expectedLevel),
                    "Correct specified levels relation or replace 'ifEnabled' by default value 'OFF'",
                    target);
        }

        String printerName = AnnotationAttribute.PRINTER.extract(target);
        if (StringUtils.hasText(printerName)) {
            Printer printer = printerResolver.resolve(printerName);
            if (isNull(printer)) {
                throw new AnnotationUsageException(method,
                        format("Unknown printer '%s'", printerName),
                        "Use correct bean name or alias to specify 'printer'",
                        target);
            }
        }
    }

    public  LogValidator(PrinterResolver printerResolver);

}