Skip to main content

A Python library to log any exceptions to standard out.

Project description

This library is designed to print any crashes which a Python program encounters when it is run to standard out.

Install: pip install TinyCrashReporter

Setup: 1. Import the library into your program. 2. Add the line -> sys.excepthook = tinycrashreporter.crashReportExceptHook <- bellow oyu imports. 3. Run your program in the command line e.g. Python3 ~/PythonFiles/MyTinyCrashReporterProgram.py

Warning: IDLE and other IDE’s appear to use the same method override as Tiny Crash Reporter and are not currently supported. Please run in a command line instead.

Example: Add the following lines of code into a blank python file. #!/usr/bin/env python # set up tiny crash reporter: import sys

import (…any_other_module…)

import tinycrashreporter

sys.excepthook = tinycrashreporter.crashReportExceptHook

# Add some crashy code

1/0

Blank file:

A blank file, which includes the code above and conforms to the specification has been included LibraryLocation/Samples/ImportedLibraryOnly.py

In teminal run -> python3 ImportedLibraryOnly.py The library also works in python 2.7.

File with options:

A file called CrashyProgram.py has also been set up which supports the execution of code passed as an argument. This is for testing purposes and this code should not be published as part of a release project due to it’s inherent insecurities.

In terminal run -> python3 CrashyProgram.py

Unit tests:

8 Tests are available in LibraryLocation/CrashTest.py to run these, manually edit the file path in CrashTest.py to point to CrashyProgram.py. Then…

In terminal run -> python3 ~/SampleLocation/CrashTest.py -v

One of the tests requests user to input some crashy code. This facility doesn’t work with “ or ‘ characters and the inclusion of some other special characters may cause similar errors. More work is needed to properly escape the input.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiny_crash_reporter-0.4.tar.gz (6.6 kB view details)

Uploaded Source

File details

Details for the file tiny_crash_reporter-0.4.tar.gz.

File metadata

File hashes

Hashes for tiny_crash_reporter-0.4.tar.gz
Algorithm Hash digest
SHA256 e5ac0d452baf0bdfee31930f9018bfce519431e915e7e294a21af6c9e5e9ecb5
MD5 2fac5caa6ee2d26b4a065c5fb5ae57df
BLAKE2b-256 e44bb09f0ae88f491a7b385dc7cffdda14f84aafe8c3897d3b6e8b0e4d4e38a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page