Ticket #3289: really-minimal.py
| File really-minimal.py, 373 bytes (added by glyph, 4 years ago) |
|---|
| Line | |
|---|---|
| 1 | |
| 2 | import sys |
| 3 | from twisted.python.log import startLogging, msg, addObserver |
| 4 | from twisted.python import failure |
| 5 | failure.traceupLength = 0 |
| 6 | |
| 7 | realstdout = sys.stdout |
| 8 | def showError(eventDict): |
| 9 | if eventDict['isError']: |
| 10 | realstdout.write(eventDict['failure'].getTraceback()) |
| 11 | addObserver(showError) |
| 12 | |
| 13 | startLogging(sys.stdout) |
| 14 | startLogging(sys.stdout) |
| 15 | |
| 16 | msg("Hello, World!") |
