public class ERXNSPrintWriterLogger
extends com.webobjects.foundation.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);
Constructor and Description |
---|
ERXNSPrintWriterLogger() |
ERXNSPrintWriterLogger(PrintStream printStream) |
ERXNSPrintWriterLogger(PrintWriter printWriter) |
ERXNSPrintWriterLogger(String encodingName) |
Modifier and Type | Method and Description |
---|---|
void |
appendln() |
void |
appendln(Object object) |
void |
flush() |
public ERXNSPrintWriterLogger()
public ERXNSPrintWriterLogger(PrintWriter printWriter)
public ERXNSPrintWriterLogger(PrintStream printStream)
public ERXNSPrintWriterLogger(String encodingName) throws UnsupportedEncodingException
UnsupportedEncodingException
public void appendln()
appendln
in class com.webobjects.foundation.NSLog.Logger
public void appendln(Object object)
appendln
in class com.webobjects.foundation.NSLog.Logger
public void flush()
flush
in class com.webobjects.foundation.NSLog.Logger
Copyright © 2002 – 2020 Project Wonder.