239 | | sys.stderr.write("DEBUG: %s (PID %i) : %s\n" % (self.MyName, os.getpid(), message)) |
240 | | sys.stderr.flush() |
241 | | |
242 | | def logInfo(self, message, level="info") : |
243 | | """Logs a message to CUPS' error_log file.""" |
244 | | sys.stderr.write("%s: %s (PID %i) : %s\n" % (level.upper(), self.MyName, os.getpid(), message)) |
245 | | sys.stderr.flush() |
| 246 | self.logInfo(message, level="debug") |
564 | | wrapper.initBackend() |
565 | | wrapper.saveDatasAndCheckSum() |
566 | | wrapper.exportAttributes() |
567 | | retcode = wrapper.runBranches() |
568 | | wrapper.cleanUp() |
| 565 | try : |
| 566 | wrapper.initBackend() |
| 567 | wrapper.saveDatasAndCheckSum() |
| 568 | wrapper.exportAttributes() |
| 569 | retcode = wrapper.runBranches() |
| 570 | wrapper.cleanUp() |
| 571 | except SystemExit, e : |
| 572 | retcode = e.code |
| 573 | except : |
| 574 | import traceback |
| 575 | lines = [] |
| 576 | for line in traceback.format_exception(*sys.exc_info()) : |
| 577 | lines.extend([l for l in line.split("\n") if l]) |
| 578 | msg = "ERROR: ".join(["%s (PID %s) : %s\n" % (wrapper.MyName, wrapper.pid, l) for l in (["ERROR: Tea4CUPS v%s" % version] + lines)]) |
| 579 | sys.stderr.write(msg) |
| 580 | sys.stderr.flush() |
| 581 | retcode = 1 |