Example usage for java.util.logging LogRecord getSourceClassName

List of usage examples for java.util.logging LogRecord getSourceClassName

Introduction

In this page you can find the example usage for java.util.logging LogRecord getSourceClassName.

Prototype

public String getSourceClassName() 

Source Link

Document

Get the name of the class that (allegedly) issued the logging request.

Usage

From source file:simj.util.logging.HTMLFormatter.java

private String getLogEntry(final LogRecord record) {
    StringBuffer buf = new StringBuffer(2048);

    buf.append("<TR>\n");
    buf.append("<TD><DIV ALIGN=\"right\">");
    buf.append(record.getSequenceNumber());
    buf.append("</DIV></TD>");
    buf.append("<TD>");

    // Bold any levels >= INFO, for instance severe error messages.
    if (record.getLevel().intValue() >= Level.INFO.intValue()) {
        buf.append("<b>");

        if (record.getLevel().intValue() >= Level.WARNING.intValue()) {
            buf.append("<i>");
            buf.append(record.getLevel());
            buf.append("</i>");
        } else {/*from  ww w. j  a  va 2 s .c  o  m*/
            buf.append(record.getLevel());
        }

        buf.append("</b>");
    } else {
        buf.append(record.getLevel());
    }

    buf.append("</TD>");
    buf.append("<TD>");
    buf.append(record.getMillis());
    buf.append("</TD>");
    buf.append("<TD>");
    buf.append(record.getSourceClassName());
    buf.append("</TD>");
    buf.append("<TD>");
    buf.append(record.getSourceMethodName());
    buf.append("</TD>");
    buf.append("<TD>");
    buf.append("\n</TR>\n");
    buf.append("<TR>\n");
    buf.append("<TD>");
    buf.append("</TD>");
    buf.append("<TD COLSPAN=\"4\">");
    buf.append("<EM>");
    buf.append(cleanUpHTML(formatMessage(record)));
    buf.append("</EM>");
    buf.append("</TD>");
    buf.append("\n</TR>\n");
    buf.append("<TR>");
    buf.append("<TD COLSPAN=\"5\"><HR SIZE=\"1\" NOSHADE></TD>");
    buf.append("</TR>\n\n");

    return buf.toString();
}