Skip to content

JonAnders/raven-csharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Instantiate the client with your DSN:

var ravenClient = new RavenClient("http://public:[email protected]/project-id");

Capturing Exceptions

Call out to the client in your catch block:

try
{
    int i2 = 0;
    int i = 10 / i2;
}
catch (Exception e)
{
    ravenClient.CaptureException(e);
}

Logging Non-Exceptions

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

ravenClient.CaptureMessage("Hello World!");

Additional Data

The capture methods allow you to provide additional data to be sent with your request. CaptureException supports both the tags and extra properties, and CaptureMessage additionally supports the level property.

The full argument specs are:

CaptureException(Exception e, IDictionary<string, string> tags = null, object extra = null)
CaptureMessage(string message, ErrorLevel level = ErrorLevel.info, Dictionary<string, string> tags = null, object extra = null)

Get it!

You can clone and build SharpRaven yourself, but for those of us who are happy with prebuilt binaries, there's a NuGet package.

Resources

About

Raven is a C# client for Sentry (getsentry.com)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 89.0%
  • XML 10.2%
  • Other 0.8%