def METHOD_NAME (self, warnstr, element=None):
    filePath = ""
    lineNo = 0
    if element:
        filePath = element.getFilePath()
        lineNo = element.getStartLineNumber()
    self.warningList.append ((filePath, lineNo, "WARNING", warnstr))