com.ibm.di.plugin.log
Class PWSyncLog
java.lang.Object
com.ibm.di.plugin.log.PWSyncLog
public class PWSyncLog
- extends Object
This is the common log class used by all of the Proxy Components.
Method Summary |
void |
close()
|
void |
debug(String msg)
|
void |
debug(String prefix,
String msg)
|
void |
error(String msg)
|
void |
error(String prefix,
String msg)
|
void |
error(String prefix,
String msg,
Throwable error)
|
void |
error(String msg,
Throwable error)
|
protected String |
getDateTime()
|
static PWSyncLog |
getLogForFile(String file,
String charSet,
boolean debug)
Open the specified file for logging. |
PrintWriter |
getPrintWriter()
|
void |
info(String msg)
|
void |
info(String prefix,
String msg)
|
boolean |
isOpen()
|
protected void |
log(String prefix,
String level,
String msg)
|
void |
plain(String msg)
|
protected void |
printStackTrace(Throwable error)
|
void |
setDebug(boolean debug)
|
void |
warn(String msg)
|
void |
warn(String prefix,
String msg)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
debug
protected boolean debug
log
protected PrintWriter log
logOpen
protected boolean logOpen
dateFormat
protected com.ibm.icu.text.DateFormat dateFormat
PWSyncLog
public PWSyncLog(OutputStream os,
String charSet,
boolean debug)
- Creates a instance of the
PWSyncLog
class.
- Parameters:
os
- the output stream to which to log. If this is null no attempt
to open a stream will be made.charSet
- the character set name used for encoding the stream.debug
- "To Debug, Or Not? ...That is the question.
getDateTime
protected String getDateTime()
log
protected void log(String prefix,
String level,
String msg)
plain
public void plain(String msg)
error
public void error(String prefix,
String msg)
error
public void error(String msg)
error
public void error(String prefix,
String msg,
Throwable error)
error
public void error(String msg,
Throwable error)
debug
public void debug(String prefix,
String msg)
debug
public void debug(String msg)
info
public void info(String prefix,
String msg)
info
public void info(String msg)
warn
public void warn(String prefix,
String msg)
warn
public void warn(String msg)
close
public void close()
isOpen
public boolean isOpen()
setDebug
public void setDebug(boolean debug)
getLogForFile
public static PWSyncLog getLogForFile(String file,
String charSet,
boolean debug)
throws FileNotFoundException
- Open the specified file for logging.
- Parameters:
file
- the file path to use.charSet
- the encoding to output to. If this is null the default
encoding would be used ()debug
- if true more verbose messages will be printed
- Returns:
- an instance of the
PWSyncLog
class.
- Throws:
FileNotFoundException
- if the file path could not be resolved.
getPrintWriter
public PrintWriter getPrintWriter()
printStackTrace
protected void printStackTrace(Throwable error)