Skip to content

Commit 4de20ab

Browse files
committed
Updated the portable readme and added a helper to startup
1 parent 289f0d8 commit 4de20ab

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

src/Exceptionless.Portable/Extensions/ExceptionlessClientExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ public static class ExceptionlessClientExtensions {
1414
/// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
1515
/// </summary>
1616
/// <param name="client">The ExceptionlessClient.</param>
17-
public static void Startup(this ExceptionlessClient client) {
17+
/// <param name="apiKey">The API key that will be used when sending events to the server.</param>
18+
public static void Startup(this ExceptionlessClient client, string apiKey = null) {
19+
client.Configuration.ApiKey = apiKey;
1820
client.Configuration.ReadAllConfig();
21+
1922
#if !PORTABLE && !NETSTANDARD1_2
2023
client.Configuration.UseTraceLogEntriesPlugin();
2124
#endif

src/Exceptionless.Portable/readme.txt

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,18 @@ and viewing your project configuration page.
1717
-------------------------------------
1818
Integration
1919
-------------------------------------
20-
NOTE: Please note that this library is a Portable Class Library (PCL). As such it is platform agnostic
21-
and doesn't know how to read configuration settings or know what error handlers to wire up to. For
22-
these reasons if you are on a known platform then use the platform specific package to save you time
23-
configuring while giving you more contextual information. For more information please read the Exceptionless
24-
Portable Class Library (PCL) Configuration section on http://docs.exceptionless.io/contents/configuration/
25-
26-
You can set your api key by calling the following code on startup:
27-
28-
ExceptionlessClient.Default.Configuration.ApiKey = "API_KEY_HERE"
29-
30-
You can also configure the client via attributes. To configure the client using attributes please add
31-
the following assembly attribute and your own Exceptionless api key to your project (E.G., AssemblyInfo class).
32-
33-
[assembly: Exceptionless.Configuration.Exceptionless("API_KEY_HERE")]
34-
35-
Finally, you must call the following line of code to read your configuration from the attribute.
36-
37-
Exceptionless.ExceptionlessClient.Default.Configuration.ReadFromAttributes()
38-
39-
Please note that you will need to pass in the the assembly that contains the attributes if you place
40-
place the above attribute outside of the entry assembly or calling assembly.
41-
42-
Exceptionless.ExceptionlessClient.Default.Configuration.ReadFromAttributes(typeof(MyClass).Assembly)
20+
This library is platform agnostic and is compiled against different runtimes. Depending on the
21+
referenced runtime, Exceptionless will attempt to wire up to available error handlers and attempt to
22+
discover configuration settings available to that runtime. For these reasons if you are on a known
23+
platform then use the platform specific package to save you time configuring while giving you more
24+
contextual information. For more information and configuration examples please read the Exceptionless
25+
Configuration documentation on http://docs.exceptionless.io/contents/configuration/
26+
27+
On app startup, import the Exceptionless namespace and call the client.Startup() extension method
28+
to wire up to any runtime specific error handlers and read any available configuration.
29+
30+
using Exceptionless;
31+
ExceptionlessClient.Default.Startup("API_KEY_HERE");
4332

4433
Please visit the wiki https://github.com/exceptionless/Exceptionless.Net/wiki/Sending-Events
4534
for examples on sending events to Exceptionless.

0 commit comments

Comments
 (0)