Skip to content

SharpRaven is lightweight the .NET client for Sentry.

Notifications You must be signed in to change notification settings

gbulicanu/raven-csharp-light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

RavenSharp Light

SharpRaven Light a lightweight .NET client for Sentry.

Disclaimer

It is a Light version of the oficial lib RavenSharp, it contains just the basic to log the event. It is designed to be compatible with the oficial lib, so it implements the same interface IClientSentry.cs. The usage is also very similar.

Usage

Instantiate the client with your DSN:

var ravenClient = new RavenClientLight("http://public:secret@example.com/project-id");

Capturing Exceptions

Call out to the client in your catch block:

try
{
    int i2 = 0;
    int i = 10 / i2;
}
catch (Exception exception)
{
    ravenClient.Capture(new SentryEvent(exception));
}

Logging Non-Exceptions

You can capture a message without being bound by an exception:

ravenClient.Capture(new SentryEvent("Hello World!"));

Additional Data

You can add additional data to the Exception.Data property on exceptions thrown about in your solution:

try
{
    // ...    
}
catch (Exception exception)
{
    exception.Data.Add("SomeKey", "SomeValue");
    throw;
}

About

SharpRaven is lightweight the .NET client for Sentry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages