Class Information
Package: com.onepg.util
Class Name: LogWriter
Description
Log writer class.
- Accepts log output from individual processes.
- Handles log text formatting.
- Gets text writer instances from log text handler
LogTxtHandlerto output logs. - Holds two log text handlers for information and error.
- Outputs logs to console in development mode.
- Opening and closing of log text is handled by the log text handler, not by this class.
Method List
flush
public void flush()
Flushes.
error
public void error(Throwable e, String msg)
Outputs error.
Parameters
| Name | Type | Description |
|---|---|---|
e |
Throwable |
error instance |
msg |
String |
log output message |
error
public void error(Throwable e)
Outputs error.
Parameters
| Name | Type | Description |
|---|---|---|
e |
Throwable |
error instance |
error
public void error(String msg)
Outputs error.
Parameters
| Name | Type | Description |
|---|---|---|
msg |
String |
log output message |
info
public void info(String msg)
Outputs information.
Parameters
| Name | Type | Description |
|---|---|---|
msg |
String |
log output message |
begin
public void begin()
Outputs start information.
end
public void end()
Outputs end information.
end
public void end(int exitStatus)
Outputs end information.
Parameters
| Name | Type | Description |
|---|---|---|
exitStatus |
int |
exit status |
develop
public void develop(String msg)
Outputs for development.
Parameters
| Name | Type | Description |
|---|---|---|
msg |
String |
log output message |
isDevelopMode
public boolean isDevelopMode()
Checks development mode.
Return Value
boolean - true if development log is enabled
startWatch
public void startWatch()
Starts elapsed time measurement.
stopWatch
public void stopWatch()
Stops elapsed time measurement.