Skip to content

Commit f020492

Browse files
chore: move HTTPClientFactory logs (#3901)
* chore:move logs * Update SdkComposer.cs --------- Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
1 parent 9a11d77 commit f020492

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/Sentry/Internal/SdkComposer.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private ITransport CreateTransport()
2323
_options.LogDebug("Creating transport.");
2424

2525
// Start from either the transport given on options, or create a new HTTP transport.
26-
var transport = _options.Transport ?? CreateHttpTransport();
26+
var transport = _options.Transport ?? new LazyHttpTransport(_options);
2727

2828
// When a cache directory path is given, wrap the transport in a caching transport.
2929
if (!string.IsNullOrWhiteSpace(_options.CacheDirectoryPath))
@@ -75,18 +75,6 @@ You can set a different environment via SENTRY_ENVIRONMENT env var or programati
7575
return transport;
7676
}
7777

78-
private LazyHttpTransport CreateHttpTransport()
79-
{
80-
if (_options.SentryHttpClientFactory is not null)
81-
{
82-
_options.LogDebug(
83-
"Using ISentryHttpClientFactory set through options: {0}.",
84-
_options.SentryHttpClientFactory.GetType().Name);
85-
}
86-
87-
return new LazyHttpTransport(_options);
88-
}
89-
9078
public IBackgroundWorker CreateBackgroundWorker()
9179
{
9280
if (_options.BackgroundWorker is { } worker)

src/Sentry/SentryOptions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ internal IEnumerable<ISdkIntegration> Integrations
222222

223223
internal HttpClient GetHttpClient()
224224
{
225+
if (SentryHttpClientFactory is not null)
226+
{
227+
DiagnosticLogger?.LogDebug(
228+
"Using ISentryHttpClientFactory set through options: {0}.",
229+
SentryHttpClientFactory.GetType().Name);
230+
}
231+
225232
var factory = SentryHttpClientFactory ?? new DefaultSentryHttpClientFactory();
226233
return factory.Create(this);
227234
}

0 commit comments

Comments
 (0)