def log_maven_output(lines): for line in lines: line = line.strip() if line.startswith("[WARNING]"): line = line[10:].rstrip() if len(line) > 0: log.warning("{!r}", line) elif line.startswith("[ERROR]"): line = line[8:].rstrip() if len(line) > 0: log.error("{!r}", line) else: pass