Code example for LogRecord

Methods: getLevelgetLoggerNamegetMillisgetThrown

0
    // MCPC+ end 
 
    public String format(LogRecord record)
    { 
        StringBuilder msg = new StringBuilder();
        msg.append(this.dateFormat.format(Long.valueOf(record.getMillis())));
        Level lvl = record.getLevel();
 
        String name = lvl.getLocalizedName();
        if ( name == null )
        { 
            name = lvl.getName();        	
        } 
 
        if ( ( name != null ) && ( name.length() > 0 ) )
        { 
            msg.append(" [" + name + "] ");
        } 
        else 
        { 
            msg.append(" ");
        } 
 
        if (record.getLoggerName() != null)
        { 
            msg.append("["+record.getLoggerName()+"] ");
        } 
        else 
        { 
            msg.append("[] ");
        } 
        msg.append(formatMessage(record));//record.getMessage());
        msg.append(LINE_SEPARATOR);
        Throwable thr = record.getThrown();
 
        if (thr != null)
        { 
            StringWriter thrDump = new StringWriter();
            thr.printStackTrace(new PrintWriter(thrDump));
Contextual code suggestions in your IDE  Get Codota for Java