https://github.com/peteruhnak/pharo-sentry
Unofficial Pharo SDK for sentry.io
https://github.com/peteruhnak/pharo-sentry
error-handling logging pharo sentry
Last synced: 2 months ago
JSON representation
Unofficial Pharo SDK for sentry.io
- Host: GitHub
- URL: https://github.com/peteruhnak/pharo-sentry
- Owner: peteruhnak
- License: mit
- Created: 2018-02-02T16:36:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T18:53:21.000Z (over 2 years ago)
- Last Synced: 2025-02-28T05:54:02.925Z (3 months ago)
- Topics: error-handling, logging, pharo, sentry
- Language: Smalltalk
- Size: 1.68 MB
- Stars: 10
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
============
pharo-sentry
============|travis| |coveralls|
*pharo-sentry* is an unofficial `Pharo `_ SDK for `Sentry `_ error tracking platform.
.. warning::
This SDK is still under development and not all Sentry's API is supported yet.
.. warning::
The API of this library is still subject to change.
For more in-depth documentation see https://peteruhnak.github.io/pharo-sentry/
Installation
============.. code-block:: smalltalk
Metacello new
baseline: 'Sentry';
repository: 'github://peteruhnak/pharo-sentry:v1.x/repository';
loadBasic Usage
===========Capturing an Exception
----------------------Exceptions are automatically serialized and dispatched:
.. code-block:: smalltalk
client := SentryClient dsn: 'https://@sentry.io/'.
[ 1 / 0 ] on: ZeroDivide do: [ :ex |
client captureException: ex
]Sending a Message
-----------------Messages contain arbitrary content that can help you debug your application or collect additional information:
.. code-block:: smalltalk
client captureMessage: 'The sun didn''t rise'
Sending Sample Events
---------------------To verify that your everything is configured correctly, you can send sample exceptions and events.
This can be done either by setting the ``level`` of the event to ``sample``. Or you can use ready-to-use events:.. code-block:: smalltalk
client sendSampleException.
client sendSampleMessage.
.. figure:: figures/sentry-sample.png
Sample exception in the sentry.io UI
Using Beacon
============*pharo-sentry* includes a Beacon logger called ``SentryLogger`` that serializes and dispatches exceptions via sentry:
.. code-block:: smalltalk
SentryLogger new runDuring: [
[ 1/0 ] on: Exception do: [ :ex | ex emit ]
].Likewise string-based signals are serialized into sentry messages:
.. code-block:: smalltalk
SentryLogger start.
StringSignal emit: 'test'.
SentryLogger stop... |travis| image:: https://travis-ci.org/peteruhnak/pharo-sentry.svg?branch=master
:target: https://travis-ci.org/peteruhnak/pharo-sentry
.. |coveralls| image:: https://coveralls.io/repos/github/peteruhnak/pharo-sentry/badge.svg?branch=master
:target: https://coveralls.io/github/peteruhnak/pharo-sentry?branch=master