You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 && $TRAVIS_PYTHON_VERSION == 2* ]]; then coverage run -m unittest2 discover python2; fi
23
-
# Coverage/Coveralls has dropped support for Python 3.2
24
-
- if [[ $TRAVIS_PYTHON_VERSION != 3.2 && $TRAVIS_PYTHON_VERSION == 3* ]]; then coverage run -m unittest discover python3; fi
25
-
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then coverage run -m unittest2 discover python2; fi
26
-
# - if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then coverage run -m unittest discover python3; fi
20
+
- if [[ $TRAVIS_PYTHON_VERSION == 2* || $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then coverage run --source=python2 -m unittest discover python2/tests; fi
21
+
- if [[ $TRAVIS_PYTHON_VERSION == 3* || $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then coverage run --source=python3 -m unittest discover python3/tests; fi
Copy file name to clipboardExpand all lines: CHANGELOG.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,26 @@
1
+
## 4.4.0 (11/08/2023):
2
+
Features:
3
+
- Added `RaygunHandler.from_sender()` factory to construct a `RaygunHandler` instance using an existing `RaygunSender`. This allows for additional configuration of the sender.
4
+
- Added a `config` parameter the to Flask and WSGI middleware provider constructors. This also allows for additional configuration of the sender.
5
+
- The `RaygunHandler` now adds tags corresponding to the logging level, which now defaults to `logging.ERROR`.
6
+
- Errors/exceptions sent via the `RaygunHandler` now have their message overriden by the logged message.
7
+
Bug fixes:
8
+
- The `RaygunHandler` now attempts to capture `exc_info` from the `record`. This can be obtained if `logger.exception()` is used or if `exc_info=True` is set in the logger call.
9
+
- If `exc_info` cannot be obtained by the `RaygunHandler`, it no longer attempts to construct a `RaygunErrorMessage` with `None` values. Instead, it generates a fallback error message using information gathered from the `record`. This is essentially an error with a single stack frame representing the call to the logger.
10
+
Quality of life updates:
11
+
- Updated `CONTRIBUTING.MD`.
12
+
- Got unit tests running again (`django` upgrade).
13
+
- Updated `python3/samples/sample.py` and `python3/samples/sampleWithLogging.py`.
14
+
- Cleaned up `python3/raygun4py/cli.py`.
15
+
1
16
## 4.3.0 (06/06/2019):
2
17
Features:
3
18
- Added a new config option, `transmit_environment_variables`, to control sending any environment variables at all
4
19
- Added support to `filter_keys` config option for ignoring keys with a simple wildcard approach. See README for more information
5
20
6
21
## 4.2.3 (28/03/2019):
7
22
Bugfixes
8
-
- Add request rawData to the build_wsgi_compliant_request utilities to fix a bug where rawData is set manually then overwritten by an empty object.
23
+
- Add request `rawData` to the `build_wsgi_compliant_request` utilities to fix a bug where `rawData` is set manually then overwritten by an empty object.
Official Raygun provider for **Python 2.7**, **Python 3+** and **PyPy**
11
+
Official Raygun provider for **Python 2.7**, **Python 3.1+** and **PyPy**
12
+
13
+
Please also refer to our `documentation site <https://raygun.com/documentation/language-guides/python/crash-reporting/installation/>`_, as this is maintained with higher priority.
12
14
13
15
14
16
Installation
@@ -18,16 +20,8 @@ The easiest way to install this is as a pip package, as it is available from PyP
Note that after sending the exception, we invoke the default :code:`sys.__excepthook__` to maintain the expected behavior for unhandled exceptions. This ensures the program terminates as it would without the custom exception handler in place.
69
+
66
70
Logging
67
71
-------
68
72
69
-
You can also send exceptions using a logger:
73
+
You can send errors/exceptions via a logger by attaching a :code:`RaygunHandler`:
Note that using a :code:`RaygunHandler` outside the scope of an :code:`except` block will not allow it to populate a full stack trace.
84
99
85
100
Web frameworks
86
101
--------------
87
102
88
-
Raygun4py includes dedicated middleware implementations for Django and Flask, as well as generic WSGI frameworks (Tornado, Bottle, Ginkgo etc). These are available for both Python 2.6/2.7 and Python 3+.
103
+
Raygun4py includes dedicated middleware implementations for Django and Flask, as well as generic WSGI frameworks (Tornado, Bottle, Ginkgo etc). These are available for both Python 2.7 and Python 3.1+.
89
104
90
105
Django
91
106
++++++
92
107
93
-
To configure Django to automatically send all exceptions that are raised in views to Raygun:
94
-
95
-
settings.py
108
+
To configure Django to automatically send all exceptions that are raised in views to Raygun, add the following to :code:`settings.py`:
96
109
97
110
.. code:: python
98
111
@@ -127,6 +140,8 @@ The above configuration is the minimal required setup. The full set of options s
127
140
Flask
128
141
+++++
129
142
143
+
To attach a request exception handler that enhances reports with Flask-specific environment data, use our middleware :code:`flask.Provider`:
144
+
130
145
.. code:: python
131
146
132
147
from flask import Flask, current_app
@@ -136,6 +151,8 @@ Flask
136
151
137
152
flask.Provider(app, 'your_apikey').attach()
138
153
154
+
The :code:`flask.Provider` constructor can also take an optional :code:`config` argument. This should be a standard :code:`Dict` of supported options, as shown in advanced configuration below. It also returns the underlying :code:`RaygunSender`, which you may decide to use elsewhere.
155
+
139
156
WSGI
140
157
++++
141
158
@@ -164,6 +181,8 @@ An example using **Tornado**, which will pick up exceptions that occur in the WS
164
181
server = wsgiref.simple_server.make_server('', 8888, raygun_wrapped_app)
165
182
server.serve_forever()
166
183
184
+
The :code:`wsgi.Provider` constructor can also take an optional :code:`config` argument. This should be a standard :code:`Dict` of supported options, as shown in advanced configuration below.
185
+
167
186
Note that many frameworks (tornado, pryramid, gevent et al) will swallow exceptions that occur within their domain.
168
187
169
188
Let us know if we're missing middleware for your framework, or feel free to submit a pull request.
@@ -355,13 +374,6 @@ For Python 3, chained exceptions are supported and automatically sent along with
355
374
356
375
This occurs when an exception is raised while handling another exception - see tests_functional.py for an example.
357
376
358
-
Troubleshooting
359
-
===============
360
-
361
-
To see the HTTP response code from sending the message to raygun, `print client.send()` (as in line 27 of test.py). It will be 403 if an invalid API key was entered, and 202 if successful.
362
-
363
-
Create a thread in the official support forums at http://raygun.io/forums, and we'll help you out.
0 commit comments