8000 GitHub - TrekBikes/Airbraker: Airbrake.io client for C#
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TrekBikes/Airbraker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Airbraker


##Get it now! using NuGet

Install-Package Airbraker

##Examples

Add the following extension class to your project in order to be able to detect the localtion of the calling routine.

using System;
using System.Runtime.CompilerServices;

namespace Airbraker
{
    public static class AirbrakeClientEx
    {
        public static void Send(this AirbrakeClient client, Exception exception,
            [CallerMemberName] string method = null,
            [CallerFilePath] string file = null,
            [CallerLineNumber] int lineNumber = 0)
        {
            client.Send(exception, method, file, lineNumber);
        }
    }
}

To configure the Airbrake client:

var config = new AirbrakeConfig
{
    ApiKey = "your-api-key",
    Environment = "dev",
    AppVersion = "1.0",
    ProjectName = "Company.YourProjectName"
};

// Initialize Airbrake client.
_airbrake = new AirbrakeClient(config);

Using the client:

try
{
    //Routine throws an exception
}
catch (Exception ex)
{
    _airbrake.Send(ex);
}

If you cannot access the [CallerMemberName], [CallerFilePath] and [CallerLineNumber] attribtues, then install the Microsoft BCL Portability Pack from NuGet:

PM> Install-Package Microsoft.Bcl

##Resources

##License

Copyright 2014 SPB TV AG

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

About

Airbrake.io client for C#

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0