Skip to content

Commit dc44091

Browse files
committed
feat(csharp): add optional logger factory parameter to SetTransformationRegion method
1 parent 118e552 commit dc44091

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

templates/csharp/api.mustache

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ namespace Algolia.Search.Clients;
162162
/// if you wish to leverage the transformation pipeline (via the *WithTransformation methods).
163163
/// </summary>
164164
/// <param name="region">The region ("us" or "eu")</param>
165-
public void SetTransformationRegion(string region)
165+
/// <param name="factory">Logger factory</param>
166+
public void SetTransformationRegion(string region, ILoggerFactory factory = null)
166167
{
167168
if (string.IsNullOrWhiteSpace(region))
168169
{
@@ -175,10 +176,6 @@ namespace Algolia.Search.Clients;
175176
throw new ArgumentException("AppId and ApiKey are required for transformation pipeline");
176177
}
177178

178-
var factory = _logger != null ?
179-
(_logger as ILogger<SearchClient>)?.Logger?.LoggerFactory :
180-
NullLoggerFactory.Instance;
181-
182179
_ingestionTransporter = new IngestionClient(
183180
_transport._algoliaConfig.AppId,
184181
_transport._algoliaConfig.ApiKey,

0 commit comments

Comments
 (0)