Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.logging
Class LogWriter  view LogWriter download LogWriter.java

java.lang.Object
  extended byjava.io.Writer
      extended byjava.io.PrintWriter
          extended bycom.lutris.logging.LogWriter

public class LogWriter
extends java.io.PrintWriter

Class use to write log output to a particular LogChannel and level. This class is PrintWriter, with println() causing a write. One should use println() with this rather than write, as with a LogChannel, since write doesn't write a full line.


Field Summary
private  LogChannel channel
           
private  boolean enabled
           
private  int level
           
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
protected LogWriter(LogChannel logChannel, int logLevel)
          Constructor.
protected LogWriter(LogChannel logChannel, java.lang.String logLevel)
          Constructor.
 
Method Summary
 LogChannel getChannel()
          Get the associate channel.
 int getLevel()
          Get the associate level.
 boolean isEnabled()
          Determine if logging is enabled.
 void println(java.lang.String msg, java.lang.Throwable throwable)
          Write a string and exception to the log file.
 
Methods inherited from class java.io.PrintWriter
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

private LogChannel channel

level

private int level

enabled

private boolean enabled
Constructor Detail

LogWriter

protected LogWriter(LogChannel logChannel,
                    java.lang.String logLevel)
Constructor.


LogWriter

protected LogWriter(LogChannel logChannel,
                    int logLevel)
Constructor.

Method Detail

getChannel

public LogChannel getChannel()
Get the associate channel.


getLevel

public int getLevel()
Get the associate level.


isEnabled

public boolean isEnabled()
Determine if logging is enabled. This is useful to prevent a series of unnecessary logging calls, as often encountered with debug logging, or a call where generating the message is expensive.


println

public void println(java.lang.String msg,
                    java.lang.Throwable throwable)
Write a string and exception to the log file.