This SDK is still under development and not all Sentry's API is supported yet.
The API of this library is still subject to change.
For more in-depth documentation see https://peteruhnak.github.io/pharo-sentry/
Metacello new baseline: 'Sentry'; repository: 'github://peteruhnak/pharo-sentry:v1.x/repository'; load
Capturing an Exception
Exceptions are automatically serialized and dispatched:
client := SentryClient dsn: 'https://<key>@sentry.io/<project>'. [ 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:
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:
client sendSampleException. client sendSampleMessage.
pharo-sentry includes a Beacon logger called
SentryLogger that serializes and dispatches exceptions via sentry:
SentryLogger new runDuring: [ [ 1/0 ] on: Exception do: [ :ex | ex emit ] ].
Likewise string-based signals are serialized into sentry messages:
SentryLogger start. StringSignal emit: 'test'. SentryLogger stop.