vs.debug
Class HTMLLogFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by vs.debug.HTMLLogFormatter

public class HTMLLogFormatter
extends java.util.logging.Formatter

This custom formatter formats parts of a log record.

Author:
swartjes Created on 7-jun-2005

Field Summary
static java.lang.String[] FINE
           
static java.lang.String[] HEADER
           
static java.lang.String[] INFO
           
static java.lang.String[] SEVERE
           
static java.lang.String TABLEBG
           
static java.lang.String[] WARNING
           
 
Constructor Summary
HTMLLogFormatter()
           
 
Method Summary
static java.lang.String escapeHTML(java.lang.String src)
           
 java.lang.String format(java.util.logging.LogRecord rec)
          Formats a log record
 java.lang.String genCell(java.lang.String msg, java.lang.String[] settings)
          Generates a table cell, with given settings
 java.lang.String getHead(java.util.logging.Handler h)
          Returns the head of the log file
 java.lang.String getTail(java.util.logging.Handler h)
          Returns the tail of the log file
 void setTitle(java.lang.String title)
          Sets the title of this log file, displayed on top.
 
Methods inherited from class java.util.logging.Formatter
formatMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER

public static java.lang.String[] HEADER

TABLEBG

public static java.lang.String TABLEBG

FINE

public static java.lang.String[] FINE

INFO

public static java.lang.String[] INFO

WARNING

public static java.lang.String[] WARNING

SEVERE

public static java.lang.String[] SEVERE
Constructor Detail

HTMLLogFormatter

public HTMLLogFormatter()
Method Detail

escapeHTML

public static java.lang.String escapeHTML(java.lang.String src)

format

public java.lang.String format(java.util.logging.LogRecord rec)
Formats a log record

Specified by:
format in class java.util.logging.Formatter
Parameters:
rec - The record to format

genCell

public java.lang.String genCell(java.lang.String msg,
                                java.lang.String[] settings)
Generates a table cell, with given settings

Parameters:
msg - The HTML contents of the cell
settings - The settings (like foreground color, background color)
Returns:
the HTML of the cell

getHead

public java.lang.String getHead(java.util.logging.Handler h)
Returns the head of the log file

Overrides:
getHead in class java.util.logging.Formatter
Parameters:
h - the handler

getTail

public java.lang.String getTail(java.util.logging.Handler h)
Returns the tail of the log file

Overrides:
getTail in class java.util.logging.Formatter
Parameters:
h - the handler

setTitle

public void setTitle(java.lang.String title)
Sets the title of this log file, displayed on top.

Parameters:
title - the title