Package com.log4jviewer.logfile.fields

Examples of com.log4jviewer.logfile.fields.NamedField


        final String relativeTimeDateFormat = "RELATIVE";
        AbstractField logField = null;

        switch (patternChar) {
        case 'c':
            logField = new NamedField(LogFieldName.CATEGORY, leftAlign, rightAlign, extractPrecisionOption());
            break;

        case 'C':
            logField = new NamedField(LogFieldName.CLASS, leftAlign, rightAlign, extractPrecisionOption());
            break;

        case 'd':
            String dateFormatString = "yyyy-MM-dd HH:mm:ss,SSS"; // 'ISO8601' date format
            String dOpt = extractOption();

            if ((dOpt != null) && !dOpt.equalsIgnoreCase(isoDateFormat)) {
                if (dOpt.equalsIgnoreCase(absTimeDateFormat)) {
                    dateFormatString = "HH:mm:ss,SSS";
                } else if (dOpt.equalsIgnoreCase(dateAndTimeDateFormat)) {
                    dateFormatString = "dd MMM yyyy HH:mm:ss,SSS";
                } else if (dOpt.equalsIgnoreCase(relativeTimeDateFormat)) {
                    dateFormatString = "SSSS";
                } else {
                    dateFormatString = dOpt;
                }
            }

            logField = new DateField(LogFieldName.DATE, leftAlign, rightAlign, dateFormatString);
            break;

        case 'F':
            logField = new NamedField(LogFieldName.FILE, leftAlign, rightAlign, 2);
            break;

        case 'L':
            logField = new NumberedField(LogFieldName.LINE, leftAlign, rightAlign);
            break;

        case 'm':
            logField = new WildcardField(LogFieldName.MESSAGE, leftAlign, rightAlign);
            break;

        case 'M':
            logField = new NamedField(LogFieldName.METHOD, leftAlign, rightAlign, 1);
            break;

        case 'p':
            logField = new LevelField(LogFieldName.LEVEL, leftAlign, rightAlign);
            break;
View Full Code Here

TOP

Related Classes of com.log4jviewer.logfile.fields.NamedField

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.