kotkabeans
Class Log.NamedLog

java.lang.Object
  |
  +--kotkabeans.Log.NamedLog
Enclosing class:
Log

public static class Log.NamedLog
extends java.lang.Object

Title: NamedLog

Description: Named log file to log if this log is needed

Copyright: jyu Copyright (c) 2002

Company: jty

Usage:

To log only when selected to log, use named logs
Log.NamedLog debugLog = Log.getLog("debug"); debugLog.log("sentence");
To change named log active or not active
debugLog.setActive(true);


Field Summary
protected  boolean active
           
protected  java.lang.String logname
           
 
Constructor Summary
Log.NamedLog()
           
 
Method Summary
 boolean isActive()
          Tells if named log is activated for logging or not
 void log(java.lang.String sentence)
          Logs the sentence to log file if log is active
 void log(java.lang.String sentence, java.lang.Exception e)
          Logs the sentence and exception message and stack to logfile if log is active
 void logStack()
          Logs current call stack to logfile if log is active
 void logStack(int ignoreCalls)
          Logs current call stack to logfile if log is active
 void setActive(boolean b)
          Sets if named log is activated for logging or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

active

protected boolean active

logname

protected java.lang.String logname
Constructor Detail

Log.NamedLog

public Log.NamedLog()
Method Detail

log

public void log(java.lang.String sentence)
Logs the sentence to log file if log is active

Parameters:
sentence - String to log

log

public void log(java.lang.String sentence,
                java.lang.Exception e)
Logs the sentence and exception message and stack to logfile if log is active

Parameters:
sentence - String to log
e - Exception to log

logStack

public void logStack(int ignoreCalls)
Logs current call stack to logfile if log is active

Parameters:
ignoreCalls - how many call levels ignored

logStack

public void logStack()
Logs current call stack to logfile if log is active


setActive

public void setActive(boolean b)
Sets if named log is activated for logging or not

Parameters:
b - Value to set for active

isActive

public boolean isActive()
Tells if named log is activated for logging or not

Returns:
current state of active