Project Wonder 2.0

er.extensions
Class ERXNSPrintWriterLogger

java.lang.Object
  extended bycom.webobjects.foundation.NSLog.Logger
      extended byer.extensions.ERXNSPrintWriterLogger

public class ERXNSPrintWriterLogger
extends NSLog.Logger

ERXNSPrintWriterLogger is an alternative of NSLog.PrintStreamLogger but accepts character oriented PrintWriter instead of byte oriented PrintStream so that the character encoding for logging can be explicitly set.

Usage:

 // Create a PrintWriter with Japanese "SJIS" encoding. 
 OutputStreamWriter sjisOutWriter = new OutputStreamWriter(new FileOutputStream("app.log"), "SJIS");
 PrintWriter sjisPrintWriter = new PrintWriter(sjisOutWriter, true);

 // Create a logger then set it to NSLog.
 NSLog.Logger logger = new ERXNSPrintWriterLogger(sjisPrintWriter);
 NSLog.setDebug(logger);
 NSLog.setOut(logger);
 NSLog.setErr(logger);
 


Field Summary
 
Fields inherited from class com.webobjects.foundation.NSLog.Logger
debugLevel, isEnabled, isVerbose
 
Constructor Summary
ERXNSPrintWriterLogger()
           
ERXNSPrintWriterLogger(PrintStream printStream)
           
ERXNSPrintWriterLogger(PrintWriter printWriter)
           
ERXNSPrintWriterLogger(String encodingName)
           
 
Method Summary
 void appendln()
           
 void appendln(Object object)
           
 void flush()
           
 
Methods inherited from class com.webobjects.foundation.NSLog.Logger
allowedDebugLevel, appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, appendln, isEnabled, isVerbose, setAllowedDebugLevel, setIsEnabled, setIsVerbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXNSPrintWriterLogger

public ERXNSPrintWriterLogger()

ERXNSPrintWriterLogger

public ERXNSPrintWriterLogger(PrintWriter printWriter)

ERXNSPrintWriterLogger

public ERXNSPrintWriterLogger(PrintStream printStream)

ERXNSPrintWriterLogger

public ERXNSPrintWriterLogger(String encodingName)
                       throws UnsupportedEncodingException
Method Detail

appendln

public void appendln()

appendln

public void appendln(Object object)

flush

public void flush()

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.