(LogRecord record)
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public String format(LogRecord record) { |
| 50 | dat.setTime(record.getMillis()); |
| 51 | String source; |
| 52 | if (record.getSourceClassName() != null) { |
| 53 | source = record.getSourceClassName().substring(record.getSourceClassName().lastIndexOf('.') + 1); |
| 54 | if (record.getSourceMethodName() != null) { |
| 55 | source += "." + record.getSourceMethodName(); |
| 56 | } |
| 57 | } else { |
| 58 | source = record.getLoggerName(); |
| 59 | } |
| 60 | String message = formatMessage(record); |
| 61 | String throwable = ""; |
| 62 | if (record.getThrown() != null) { |
| 63 | StringWriter sw = new StringWriter(); |
| 64 | PrintWriter pw = new PrintWriter(sw); |
| 65 | pw.println(); |
| 66 | record.getThrown().printStackTrace(pw); |
| 67 | pw.close(); |
| 68 | throwable = sw.toString(); |
| 69 | } |
| 70 | return String.format(format, |
| 71 | dat, |
| 72 | source, |
| 73 | record.getLoggerName(), |
| 74 | record.getLevel(), |
| 75 | message, |
| 76 | throwable); |
| 77 | } |
| 78 | |
| 79 | } |
no test coverage detected