er.extensions
Class ERXNSPrintWriterLogger
java.lang.Object
com.webobjects.foundation.NSLog.Logger
er.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);
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 |
ERXNSPrintWriterLogger
public ERXNSPrintWriterLogger()
ERXNSPrintWriterLogger
public ERXNSPrintWriterLogger(PrintWriter printWriter)
ERXNSPrintWriterLogger
public ERXNSPrintWriterLogger(PrintStream printStream)
ERXNSPrintWriterLogger
public ERXNSPrintWriterLogger(String encodingName)
throws UnsupportedEncodingException
appendln
public void appendln()
appendln
public void appendln(Object object)
flush
public void flush()
Copyright © 2002 – 2004 Project Wonder.