public class ErrorLogger
extends java.lang.Object
implements java.io.Serializable
ErrorLogger errorLogger = ErrorLogger.newInstance(String s): get new logger for s
MessageLog errorLog = errorLogger.logError(string msg, cell c, int k): Create a new log with message 'msg', for cell 'c', with sortKey 'k'.
Various methods for adding highlights to errorLog:
To end logging, call errorLogger.termLogging(boolean explain).
Modifier and Type | Class and Description |
---|---|
static class |
ErrorLogger.MessageLog
Create a Log of a single message.
|
static class |
ErrorLogger.WarningLog
Create a Log of a single warning.
|
static class |
ErrorLogger.XMLParser |
Constructor and Description |
---|
ErrorLogger() |
Modifier and Type | Method and Description |
---|---|
void |
addMessages(java.util.List<ErrorLogger.MessageLog> messages) |
void |
clearAllLogs()
Method to remove all errors and warnings
|
boolean |
clearLogs(Cell cell)
Removes all errors and warnings associated with Cell cell.
|
void |
deleteLog(int i) |
void |
deleteMessages(java.util.List<ErrorLogger.MessageLog> messages) |
void |
exportErrorLogger(java.lang.String filePath) |
boolean |
findMessage(Cell cell,
Geometric geom1,
Cell cell2,
Geometric geom2,
boolean searchInError)
Method to determine if existing report was not looged already
as error or warning
|
java.util.List<ErrorLogger.MessageLog> |
getAllLogs(Cell cell)
Method to retrieve all MessageLogs associated with a given Cell
|
java.lang.String |
getGroupName(int sortKey)
Get a group name for a sortKey.
|
java.lang.String |
getInfo()
Method to retrieve general information about the errorLogger.
|
ErrorLogger.MessageLog |
getLog(int i) |
int |
getLogIndex(ErrorLogger.MessageLog log) |
java.util.Iterator<ErrorLogger.MessageLog> |
getLogs()
Method to list all logged errors and warnings.
|
int |
getNumErrors()
Method to tell the number of logged errors.
|
int |
getNumLogs()
Method to tell the number of logged errors.
|
int |
getNumMessages(Cell cell,
boolean searchInError) |
int |
getNumWarnings()
Method to tell the number of logged errors.
|
java.util.Map<java.lang.Integer,java.lang.String> |
getSortKeyToGroupNames() |
java.lang.String |
getSystem() |
boolean |
isPersistent() |
void |
logError(java.lang.String message,
CellId cellId,
int sortKey)
Factory method to log an error message.
|
void |
logError(java.lang.String message,
Cell cell,
int sortKey)
Factory method to log an error message.
|
void |
logError(java.lang.String message,
EPoint pt,
Cell cell,
int sortKey)
Factory method to log an error message.
|
void |
logError(java.lang.String message,
Export pp,
int sortKey)
Factory method to log an error message.
|
void |
logError(java.lang.String message,
Geometric geom,
Cell cell,
VarContext context,
int sortKey)
Factory method to log an error message.
|
void |
logError(java.lang.String message,
int sortKey)
Factory method to log an error message.
|
void |
logError(java.lang.String message,
PolyBase poly,
Cell cell,
int sortKey)
Factory method to log an error message.
|
void |
logMessage(java.lang.String message,
java.util.List<?> list,
Cell cell,
int sortKey,
boolean isErrorMsg)
Factory method to log an error or warning message.
|
void |
logMessage(java.lang.String message,
java.util.List<Geometric> geomList,
java.util.List<PolyBase> polyList,
Cell cell,
int sortKey,
boolean errorMsg)
Factory method to log an error or a warning message.
|
void |
logMessageWithLines(java.lang.String message,
java.util.List<?> list,
java.util.List<EPoint> lineList,
Cell cell,
int sortKey,
boolean isErrorMsg)
Factory method to log an error or warning message with extra lines.
|
void |
logWarning(java.lang.String message,
Cell cell,
int sortKey)
Factory method to log a warning message.
|
void |
logWarning(java.lang.String message,
Export pp,
Cell cell,
VarContext context,
int sortKey)
Factory method to log a warning message.
|
void |
logWarning(java.lang.String message,
Geometric geom,
Cell cell,
VarContext context,
int sortKey)
Factory method to log a warning message.
|
static ErrorLogger |
newInstance(java.lang.String system)
Create a new ErrorLogger instance.
|
static ErrorLogger |
newInstance(java.lang.String system,
boolean persistent)
Create a new ErrorLogger instance.
|
static ErrorLogger |
read(IdReader reader) |
void |
setGroupName(int sortKey,
java.lang.String groupName)
Set a group name for a sortKey.
|
void |
sortLogs()
Method to sort the errors by their "key" (a value provided to "logerror()").
|
void |
termLogging_(boolean terminate) |
void |
termLogging(boolean explain)
Method called when all errors are logged.
|
void |
write(IdWriter writer) |
static void |
writeXmlHeader(java.lang.String indent,
java.io.PrintStream ps)
Function to write all headers related to ErrorLogger classes.
|
public static void writeXmlHeader(java.lang.String indent, java.io.PrintStream ps)
indent
- ps
- public java.util.Map<java.lang.Integer,java.lang.String> getSortKeyToGroupNames()
public java.lang.String getSystem()
public boolean isPersistent()
public void write(IdWriter writer) throws java.io.IOException
java.io.IOException
public static ErrorLogger read(IdReader reader) throws java.io.IOException
java.io.IOException
public static ErrorLogger newInstance(java.lang.String system)
public static ErrorLogger newInstance(java.lang.String system, boolean persistent)
public void addMessages(java.util.List<ErrorLogger.MessageLog> messages)
public void deleteMessages(java.util.List<ErrorLogger.MessageLog> messages)
public void logError(java.lang.String message, int sortKey)
message
- the string to display.sortKey
- the sorting order of this message.public void logError(java.lang.String message, Cell cell, int sortKey)
message
- the string to display.cell
- the cell in which this message applies.sortKey
- the sorting order of this message.public void logError(java.lang.String message, CellId cellId, int sortKey)
message
- the string to display.cellId
- the Id of the cell in which this message applies.sortKey
- the sorting order of this message.public void logError(java.lang.String message, Geometric geom, Cell cell, VarContext context, int sortKey)
message
- the string to display.geom
- the node or arc to displaycell
- the cell in which this message applies.context
- the VarContext of the Cell.sortKey
- the sorting order of this message.public void logError(java.lang.String message, Export pp, int sortKey)
message
- the string to display.pp
- the Export to displaysortKey
- the sorting order of this message.public void logError(java.lang.String message, EPoint pt, Cell cell, int sortKey)
message
- the string to display.pt
- the point to displaycell
- the cell in which this message applies.sortKey
- the sorting order of this message.public void logError(java.lang.String message, PolyBase poly, Cell cell, int sortKey)
message
- the string to display.poly
- the polygon to displaycell
- the cell in which this message applies.sortKey
- the sorting order of this message.public void logMessage(java.lang.String message, java.util.List<?> list, Cell cell, int sortKey, boolean isErrorMsg)
message
- the string to display.list
- a list of nodes, arcs, exports or polygons, points to display. Must be no null.cell
- the cell in which this message applies.sortKey
- the sorting order of this message.isErrorMsg
- true if an error message is loggedpublic void logMessageWithLines(java.lang.String message, java.util.List<?> list, java.util.List<EPoint> lineList, Cell cell, int sortKey, boolean isErrorMsg)
message
- the string to display.list
- a list of nodes, arcs, exports or polygons, points to display. Must be no null.lineList
- a list of points defining a set of lines (may be null)cell
- the cell in which this message applies.sortKey
- the sorting order of this message.isErrorMsg
- true if an error message is loggedpublic void logMessage(java.lang.String message, java.util.List<Geometric> geomList, java.util.List<PolyBase> polyList, Cell cell, int sortKey, boolean errorMsg)
message
- the string to display.geomList
- a list of nodes or arcs to display (may be null).polyList
- a list of polygons to display (may be null).cell
- the cell in which this message applies.sortKey
- the sorting order of this message.errorMsg
- public void logWarning(java.lang.String message, Cell cell, int sortKey)
message
- the string to display.cell
- the cell in which this message applies.sortKey
- the sorting order of this message.public void logWarning(java.lang.String message, Geometric geom, Cell cell, VarContext context, int sortKey)
message
- the string to display.geom
- a node or arc to display.cell
- the cell in which this message applies.context
- the VarContext of the Cell.sortKey
- the sorting order of this message.public void logWarning(java.lang.String message, Export pp, Cell cell, VarContext context, int sortKey)
message
- the string to display.pp
- an Exports to display.cell
- the cell in which this message applies.context
- the VarContext of the Cell.sortKey
- the sorting order of this message.public int getNumMessages(Cell cell, boolean searchInError)
public boolean findMessage(Cell cell, Geometric geom1, Cell cell2, Geometric geom2, boolean searchInError)
public void clearAllLogs()
public java.util.List<ErrorLogger.MessageLog> getAllLogs(Cell cell)
cell
- the Cell to examine.public boolean clearLogs(Cell cell)
cell
- the cell for which errors and warnings will be removedpublic void exportErrorLogger(java.lang.String filePath)
public void setGroupName(int sortKey, java.lang.String groupName)
sortKey
- the error log sortKeygroupName
- the group namepublic java.lang.String getGroupName(int sortKey)
sortKey
- the error log sortKeypublic void termLogging(boolean explain)
public void termLogging_(boolean terminate)
public java.lang.String getInfo()
public void sortLogs()
public int getNumErrors()
public int getNumWarnings()
public int getNumLogs()
public ErrorLogger.MessageLog getLog(int i)
public int getLogIndex(ErrorLogger.MessageLog log)
public java.util.Iterator<ErrorLogger.MessageLog> getLogs()
public void deleteLog(int i)