Perforce

com.perforce.api
Class EventLog

java.lang.Object
  |
  +--com.perforce.api.EventLog

public class EventLog
extends Object

This class controls an event log. A set number of log entries are kept in memory, while all log entries are sent to a log file.

Version:
$Date: 2001/11/02 $ $Revision: #1 $
Author:
David Markley

Constructor Summary
EventLog()
          Default, no-argument constructor.
EventLog(String title)
          Constructor that accepts the title for this.
EventLog(String title, String filename)
           
 
Method Summary
static void commonLog(String event)
          Logs an event to the common log.
static void commonLog(String event, String level)
          Logs an event to the common log.
static void commonLog(String event, String level, boolean encode)
           
 String getFileName()
           
 Enumeration getLog()
          Returns an Enumeration that contains all the events in the log.
 int getSize()
           
 String getTitle()
          Gets the title of the log.
 void log(String event)
           
 void log(String event, String level)
           
 void log(String event, String level, boolean encode)
          Logs an event.
static void printLog(EventLog elog, PrintWriter out, String format)
           
static void printLog(PrintWriter out, String format)
           
 void setSize(int size)
          Sets the size of the log.
 void setTitle(String title)
          Sets the title for this log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventLog

public EventLog()
Default, no-argument constructor. This initialized the Vector of events and the date and time format.
See Also:
Vector

EventLog

public EventLog(String title)
Constructor that accepts the title for this. The title is used when the webSend() method is invoked.
Parameters:
title - The title for this log.

EventLog

public EventLog(String title,
                String filename)
Method Detail

commonLog

public static void commonLog(String event)
Logs an event to the common log. The event passed in is added to the log. If the log is beyond its maximum size, then the oldest events are dropped.
Parameters:
event - The event to be logged.

commonLog

public static void commonLog(String event,
                             String level)
Logs an event to the common log. The event passed in is added to the log. If the log is beyond its maximum size, then the oldest events are dropped.
Parameters:
event - The event to be logged.

commonLog

public static void commonLog(String event,
                             String level,
                             boolean encode)

getFileName

public String getFileName()

getLog

public Enumeration getLog()
Returns an Enumeration that contains all the events in the log.
Returns:
List of all events in the log.

getSize

public int getSize()

getTitle

public String getTitle()
Gets the title of the log.

log

public void log(String event)

log

public void log(String event,
                String level)

log

public void log(String event,
                String level,
                boolean encode)
Logs an event. The event passed in is added to the log. If the log is beyond its maximum size, then the oldest events are dropped.
Parameters:
event - The event to be logged.

printLog

public static void printLog(EventLog elog,
                            PrintWriter out,
                            String format)

printLog

public static void printLog(PrintWriter out,
                            String format)

setSize

public void setSize(int size)
Sets the size of the log. This is the maximum number of lines that the log will maintain.
Parameters:
size - The number of lines to keep in the log.

setTitle

public void setTitle(String title)
Sets the title for this log.
Parameters:
title - The title of the log.

Perforce

Copyright © 2001, Perforce Software, All rights reserved.