Package java.util.logging

Examples of java.util.logging.Level$KnownLevel


    /**
     * @param props
     */
    private void setupEarlyLogging(final JSPFProperties props) {

        Level level = null;

        // Setup JSPF logging level
        final String logging = $(getParameter("logging")).get("default");

        if (!logging.equals("default")) {
View Full Code Here


    @Override
    public String format(final LogRecord record) {
        final StringBuilder sb = new StringBuilder();

        final Level level = record.getLevel();

        // Did I mention that I sometimes (quite frequently) really hate Java?
        if (level.intValue() == Level.SEVERE.intValue()) {
            sb.append("(!SEVERE!)");
        } else if (level.intValue() == Level.WARNING.intValue()) {
            sb.append("(!)");
        } else if (level.intValue() == Level.FINE.intValue()) {
            sb.append("    ");
        } else if (level.intValue() == Level.FINER.intValue()) {
            sb.append("     ");
        } else if (level.intValue() == Level.FINEST.intValue()) {
            sb.append("      ");
        } else {
            sb.append("   ");
        }
View Full Code Here

    public void validateParameter(final String parameterName, final ModelNode value) throws OperationFailedException {
        super.validateParameter(parameterName, value);
        if (value.isDefined()) {
            final String levelString = value.asString();
            try {
                final Level level = ModelParser.parseLevel(value);
                if (!allowedValues.contains(level)) {
                    throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidLogLevel(levelString)));
                }
            } catch (IllegalArgumentException e) {
                throw new OperationFailedException(new ModelNode().set(MESSAGES.invalidLogLevel(levelString)));
View Full Code Here

        } else if (node.hasDefined(CommonAttributes.DENY.getName())) {
            return DenyAllFilter.getInstance();
        } else if (node.hasDefined(CommonAttributes.LEVEL.getName())) {
            return new LevelFilter(parseLevel(CommonAttributes.LEVEL.resolveModelAttribute(context, node)));
        } else if (node.hasDefined(CommonAttributes.LEVEL_RANGE.getName())) {
            final Level min = parseLevel(CommonAttributes.MIN_LEVEL.resolveModelAttribute(context, node));
            final Level max = parseLevel(CommonAttributes.MAX_LEVEL.resolveModelAttribute(context, node));
            final boolean minInclusive = CommonAttributes.MIN_INCLUSIVE.resolveModelAttribute(context, node).asBoolean();
            final boolean maxInclusive = CommonAttributes.MAX_INCLUSIVE.resolveModelAttribute(context, node).asBoolean();
            return new LevelRangeFilter(min, minInclusive, max, maxInclusive);
        } else if (node.hasDefined(CommonAttributes.MATCH.getName())) {
            return new RegexFilter(CommonAttributes.PATTERN.resolveModelAttribute(context, node).asString());
View Full Code Here

        }

        @Override
        public void testStarted(Description description) throws Exception
        {
            Level level = this.logger.getLevel();

            this.logger.setLevel(Level.INFO);
            this.logger.info("[run] " + description.getClassName() + "#" + description.getMethodName());
            try
            {
View Full Code Here

        }

        @Override
        public void testFinished(Description description) throws Exception
        {
            Level level = this.logger.getLevel();

            this.logger.setLevel(Level.INFO);
            this.logger.info("[finished] " + description.getClassName() + "#" + description.getMethodName());
            try
            {
View Full Code Here

        }

        @Override
        public void testFailure(Failure failure) throws Exception
        {
            Level level = this.logger.getLevel();

            this.logger.setLevel(Level.INFO);
            Description description = failure.getDescription();
            this.logger.info("[failed] " + description.getClassName() + "#" + description.getMethodName() +
                    " message: " + failure.getMessage());
View Full Code Here

        Logger logger = Logger.getLogger(className);
        Method[] methods = monitorInterface.getMethods();
        Map<String, Level> levels = new HashMap<String, Level>(methods.length);
        for (Method method : methods) {
            String key = className + '#' + method.getName();
            Level level = this.levels.get(key);

            // if not specified the in config properties, look for an annotation on the method
            if (level == null) {
                LogLevel annotation = method.getAnnotation(LogLevel.class);
                if (annotation != null && annotation.value() != null) {
View Full Code Here

            this.bundle = bundle;
        }

        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            String sourceMethod = method.getName();
            Level level = methodLevels.get(sourceMethod);
            if (level != null && logger.isLoggable(level)) {
                // construct the key for the resource bundle
                String className = logger.getName();
                String key = className + '#' + sourceMethod;
View Full Code Here

                    _nestedItems = items.iterator();
                    return hasNext();
                }
                else
                {
                    Level level = Level.FINE;
                    if (!_facesContext.isProjectStage(ProjectStage.Production))
                    {
                        level = Level.WARNING;
                    }
View Full Code Here

TOP

Related Classes of java.util.logging.Level$KnownLevel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.