Skip to content

Commit 56a1e94

Browse files
author
Jason Fauchelle
committed
Readme
1 parent dd0d994 commit 56a1e94

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed

Mindscape.Raygun4Unity/RaygunClient.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ private static void HandleException(string message, string stackTrace, LogType t
8888
}
8989
}
9090

91+
/// <summary>
92+
/// Gets the <see cref="RaygunClient"/> created by the Attach method.
93+
/// </summary>
94+
public static RaygunClient Current
95+
{
96+
get { return _current; }
97+
}
98+
9199
/// <summary>
92100
/// Transmits Unity exception information to Raygun.io synchronously.
93101
/// </summary>

README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,57 @@
1-
raygun4unity
1+
Raygun4Unity
22
============
33

4-
Raygun.io support for Unity 3D
4+
Where is my app API key?
5+
====================
6+
7+
When sending exceptions to the Raygun.io service, an app API key is required to map the messages to your application.
8+
9+
When you create a new application on your Raygun.io dashboard, your app API key is displayed at the top of the instructions page. You can also find the API key by clicking the "Application Settings" button in the side bar of the Raygun.io dashboard.
10+
11+
Namespace
12+
====================
13+
The main classes can be found in the Mindscape.Raygun4Unity namespace.
14+
15+
Usage
16+
====================
17+
18+
Raygun4Unity can be used in two main ways: automatically, and manually.
19+
20+
####Automatically
21+
22+
You can setup Raygun4Unity to automatically send all unhandled exceptions with the following single line of code. This code should be placed in a C# script file that will be called in the initialization process of the game.
23+
24+
```
25+
RaygunClient.Attach("YOUR_APP_API_KEY");
26+
```
27+
28+
####Manually
29+
30+
If you already have your own centralized logging system in place, then you many want to send messages to Raygun.io manually within your logging handlers.
31+
This can be done by createing a new instance of RaygunClient and using one of the Send method overloads. There are 3 different types of data that you can use in the Send methods:
32+
33+
* **Strings** provided by Unity for the error message and stack trace.
34+
* **Exception** .Net objects. Useful if you need to send handled exceptions in try/catch blocks.
35+
* **RaygunMessage** Allowing you to fully specify all the data fields that get sent to Raygun.io
36+
37+
```
38+
RaygunClient client = new RaygunClient("YOUR_APP_API_KEY");
39+
client.Send(e);
40+
```
41+
42+
Options
43+
====================
44+
45+
####Application version
46+
47+
The current version of Raygun4Unity does not automatically obtain the application version number. You can however specify this by setting the ApplicationVersion property of the RaygunClient instance.
48+
If you are using the Attach method, you can get the RaygunClient instance from the static RaygunClient.Current property.
49+
50+
####User
51+
52+
To keep track of how many users are affected by each exception, you can set the User property of the RaygunClient instance. This can be any id string of your choosing to identify each user.
53+
Ideally, try to use an id that you can use to relate back to an actual user such as a database id, or an email address. If you use an email address, the users gravitars (if found) will displayed on the Raygun.io error dashboards.
54+
55+
####Tags and custom data
56+
57+
The Send method overloads allow you to send an optional list of tags or a dictionary of object data. You can use these to provide whatever additional information you want to help you debug exceptions.

0 commit comments

Comments
 (0)