JNodeOS v1.1.5 API

edu.utah.janos.io
Class Log

java.lang.Object
  |
  +--edu.utah.janos.io.Log

public class Log
extends java.lang.Object

A Janos Log interface. A log maintains a buffer of a fixed number of messages. All messages passed to the log via logMsg() are sent to all listeners on the log.

Really just a glorified ring buffer.

Patterned after syslog(3).


Field Summary
static int ALERT
          Action must be taken immediately.
static int CRIT
          Critical conditions.
static int DBG
          Debug-level messages.
static int EMERG
          System is unusable.
static int ERR
          Error conditions.
static int INFO
          Informational messages.
static int NOTICE
          Normal but significant condition.
static int WARNING
          Warning conditions.
 
Constructor Summary
Log(java.lang.String prefix)
          Create a log.
 
Method Summary
 void addListener(LogListener ll)
          Add a listener to this log.
 void logMsg(int level, java.lang.String msg)
          Add a message to this log.
 void logThrowable(int level, java.lang.Throwable th)
          Add a message to the log thats a stack trace.
 void removeListener(LogListener ll)
           
 void setPrefix(java.lang.String prefix)
          Set the prefix message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMERG

public static final int EMERG
System is unusable.

ALERT

public static final int ALERT
Action must be taken immediately.

CRIT

public static final int CRIT
Critical conditions.

ERR

public static final int ERR
Error conditions.

WARNING

public static final int WARNING
Warning conditions.

NOTICE

public static final int NOTICE
Normal but significant condition.

INFO

public static final int INFO
Informational messages.

DBG

public static final int DBG
Debug-level messages.
Constructor Detail

Log

public Log(java.lang.String prefix)
Create a log. All messages sent to this log will be prefixed with the given prefix string.
Method Detail

setPrefix

public void setPrefix(java.lang.String prefix)
Set the prefix message.

logMsg

public void logMsg(int level,
                   java.lang.String msg)
Add a message to this log. Added to the ring buffer. All active listeners will recieve the message, too.

logThrowable

public void logThrowable(int level,
                         java.lang.Throwable th)
Add a message to the log thats a stack trace.

addListener

public void addListener(LogListener ll)
Add a listener to this log. The listener will immediately receive all buffered messages and eventually receive all future messages.

removeListener

public void removeListener(LogListener ll)

JNodeOS v1.1.5 API

This documentation is Copyright (C) 1998-2001 The University of Utah. All Rights Reserved. See the file LICENSE for distribution terms.
Documentation, software, and mailing list archives for Janos can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/