Bully Task (12.12.2005)

at.jku.fim.datalinksimulation.utils
Class Logger

java.lang.Object
  extended by at.jku.fim.datalinksimulation.utils.Logger

public class Logger
extends java.lang.Object

Title: OSI Simulation Framework

Copyright: (c) 2004-05

Company: FIM@JKU, www.fim.uni-linz.ac.at

Version:
$Id: Logger.java,v 1.1 2005/10/27 13:10:11 aputzinger Exp $
Author:
Andreas Putzinger

Field Summary
protected  java.util.ArrayList childrenLoggers
          children loggers
protected  java.lang.String description
          Logger description
static int globalTime
          Global logging time stamp
protected  int lastTimeStamp
          last time when an event was logged
protected  java.lang.StringBuffer logs
          logged text
protected  Logger parentLogger
          parent logger
 
Constructor Summary
Logger(java.lang.String description)
          Constructor to create a new logger for a component
 
Method Summary
 void addChildLogger(Logger child)
          Define a logger as logging child
 void clear()
          Clears all logged events
static void clearAllLogs()
          Empties all logs
 java.util.List getChildrenLoggers()
           
 java.lang.String getLog()
           
static java.util.List getRootLoggers()
           
 void log(java.lang.String msg)
          Log an event/message
 java.lang.String toString()
          Each logger is represented with his description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

globalTime

public static int globalTime
Global logging time stamp


description

protected java.lang.String description
Logger description


logs

protected java.lang.StringBuffer logs
logged text


lastTimeStamp

protected int lastTimeStamp
last time when an event was logged


childrenLoggers

protected java.util.ArrayList childrenLoggers
children loggers


parentLogger

protected Logger parentLogger
parent logger

Constructor Detail

Logger

public Logger(java.lang.String description)
Constructor to create a new logger for a component

Parameters:
description - Description/name of logger component
Method Detail

clearAllLogs

public static void clearAllLogs()
Empties all logs


getRootLoggers

public static java.util.List getRootLoggers()
Returns:
Returns a (copied) list of root loggers

log

public void log(java.lang.String msg)
Log an event/message

Parameters:
msg - The event/message to log

toString

public java.lang.String toString()
Each logger is represented with his description

Overrides:
toString in class java.lang.Object

getLog

public java.lang.String getLog()
Returns:
Returns logged events

clear

public void clear()
Clears all logged events


addChildLogger

public void addChildLogger(Logger child)
Define a logger as logging child

Parameters:
child - The child

getChildrenLoggers

public java.util.List getChildrenLoggers()
Returns:
Return a list of all children loggers

Bully Task (12.12.2005)

Submit a bug

Copyright 2004, 2005 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.