
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
The error log is simply a list. Each SBMLDocument maintains its own SBMLErrorLog. When a libSBML operation on SBML content results in an error, or when there is something worth noting about the SBML content, the issue is reported as an SBMLError object stored in the SBMLErrorLog list.
SBMLErrorLog is derived from XMLErrorLog, an object class that serves exactly the same purpose but for the XML parsing layer. XMLErrorLog provides crucial methods such as SBMLErrorLog.getNumErrors() for determining how many SBMLError or XMLError objects are in the log. SBMLErrorLog inherits these methods.
The general approach to working with SBMLErrorLog in user programs involves first obtaining a pointer to a log from a libSBML object such as SBMLDocument. Callers should then use SBMLErrorLog.getNumErrors() to inquire how many objects there are in the list. (The answer may be 0.) If there is at least one SBMLError object in the SBMLErrorLog instance, callers can then iterate over the list using
If you wish to simply print the error strings for a human to read, an easier and more direct way might be to use SBMLDocument.printErrors().
Definition at line 30431 of file libsbml.py.
Public Member Functions | |
| def | __eq__ |
| def | __init__ |
| def | __ne__ |
| def | clearLog |
| def | getError |
| def | getNumErrors |
| def | getNumFailsWithSeverity |
Public Attributes | |
| this | |
| def libsbml.XMLErrorLog.__eq__ | ( | self, | ||
| rhs | ||||
| ) | [inherited] |
Definition at line 30414 of file libsbml.py.
| def libsbml.SBMLErrorLog.__init__ | ( | self, | ||
| args, | ||||
| kwargs | ||||
| ) |
| def libsbml.XMLErrorLog.__ne__ | ( | self, | ||
| rhs | ||||
| ) | [inherited] |
Definition at line 30421 of file libsbml.py.
| def libsbml.XMLErrorLog.clearLog | ( | self | ) | [inherited] |
Python method signature(s):
clearLog(self)
Removes all errors from this log.
Definition at line 30399 of file libsbml.py.
| def libsbml.SBMLErrorLog.getError | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getError(self, unsigned int n)SBMLError
Returns the nth SBMLError in this log.
Callers should first inquire about the number of items in the log by using the SBMLErrorLog.getNumErrors() method. (This method is inherited from the parent class, XMLErrorLog). Attempting to using an error index number that exceed the number of errors in the log will result in a NULL being returned.
| n | unsigned int number of the error to retrieve. |
nth SBMLError in this log. Reimplemented from libsbml.XMLErrorLog.
Definition at line 30476 of file libsbml.py.
| def libsbml.XMLErrorLog.getNumErrors | ( | self | ) | [inherited] |
Python method signature(s):
getNumErrors(self)unsigned int
Returns the number of errors that have been logged.
To retrieve individual errors from the log, callers may use XMLErrorLog.getError(unsigned int n).
Definition at line 30359 of file libsbml.py.
| def libsbml.SBMLErrorLog.getNumFailsWithSeverity | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getNumFailsWithSeverity(self, unsigned int severity)unsigned int
Returns the number of errors that have been logged with the given severity code.
LibSBML associates severity levels with every SBMLError object to provide an indication of how serious the problem is. Severities range from informational diagnostics to fatal (irrecoverable) errors. Given an SBMLError object instance, a caller can interrogate it for its severity level using methods such as SBMLError.getSeverity(), SBMLError.isFatal(), and so on. The present method encapsulates iteration and interrogation of all objects in an SBMLErrorLog, making it easy to check for the presence of error objects with specific severity levels.
Definition at line 30499 of file libsbml.py.
libsbml.XMLErrorLog.this [inherited] |
Definition at line 30418 of file libsbml.py.