Skip to content

Commit b594c9e

Browse files
authored
add sentry logs alpha sdk (#236)
1 parent 4be0600 commit b594c9e

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<SentryVersion>5.11.0-alpha.1</SentryVersion>
4+
<SentryVersion>5.12.0-alpha.0</SentryVersion>
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageVersion Include="Sentry" Version="$(SentryVersion)" />

src/SymbolCollector.Android.Library/Host.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public static IHost Init(Context context, string dsn, string? sentryTrace = null
3838
{
3939
SentrySdk.Init(o =>
4040
{
41+
42+
#pragma warning disable SENTRY0001
43+
o.Experimental.EnableLogs = true;
44+
#pragma warning restore SENTRY0001
45+
4146
o.CaptureFailedRequests = true;
4247

4348
o.SetBeforeSend(@event =>

src/SymbolCollector.Core/Startup.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ public static IHost Init(Action<IServiceCollection> configureServices)
3232
.ConfigureLogging(l =>
3333
{
3434
// TODO: Should also be added via IHostBuilder extension
35-
l.AddSentry(o => o.InitializeSdk = false);
35+
l.AddSentry(o =>
36+
{
37+
#pragma warning disable SENTRY0001
38+
o.Experimental.EnableLogs = true;
39+
#pragma warning restore SENTRY0001
40+
o.InitializeSdk = false;
41+
});
3642
l.AddSimpleConsole(o => o.ColorBehavior = LoggerColorBehavior.Disabled);
3743
})
3844
.Build();

src/SymbolCollector.Runner/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
options.Debug = false;
3636
options.AutoSessionTracking = true;
3737
options.TracesSampleRate = 1.0;
38+
39+
#pragma warning disable SENTRY0001
40+
options.Experimental.EnableLogs = true;
41+
#pragma warning restore SENTRY0001
3842
});
3943

4044
var transaction = SentrySdk.StartTransaction("appium.runner", "runner appium to upload apk to saucelabs and collect symbols real devices");

src/SymbolCollector.Server/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,15 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>
7171
{
7272
o.Dsn = "https://2262a4fa0a6d409c848908ec90c3c5b4@sentry.io/1886021";
7373

74-
o.AddIntegration(new ProfilingIntegration(
75-
// Block up to 2 seconds to get profiling started before running the app
76-
TimeSpan.FromSeconds(2)));
77-
7874
o.AddExceptionFilterForType<OperationCanceledException>();
7975
o.MinimumBreadcrumbLevel = LogLevel.Debug;
8076
o.CaptureFailedRequests = true;
8177

8278
// https://github.com/getsentry/symbol-collector/issues/205
8379
// o.CaptureBlockingCalls = true;
8480

81+
o.AddProfilingIntegration(TimeSpan.FromSeconds(2));
82+
8583
o.SetBeforeSend(@event =>
8684
{
8785
// Stop raising warning that endpoint was overriden
@@ -101,6 +99,7 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>
10199
});
102100

103101
#pragma warning disable SENTRY0001
102+
o.Experimental.EnableLogs = true;
104103
o.EnableHeapDumps(20, Debouncer.PerDay(3, TimeSpan.FromHours(3)));
105104
#pragma warning restore SENTRY0001
106105
});

0 commit comments

Comments
 (0)