Skip to content

Commit 9d9d663

Browse files
committed
refactor: 消除警告信息
1 parent 8a68e03 commit 9d9d663

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/components/BootstrapBlazor.Html2Pdf/Services/DefaultPdfService.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,16 @@ private async Task<IBrowser> LaunchBrowserAsync()
161161

162162
private void Log(Exception? exception, string? message, params object?[] args)
163163
{
164-
if (args.Length != 0)
164+
if (logger.IsEnabled(LogLevel.Information))
165165
{
166-
logger.LogInformation(exception, "{Message} | Args: {Args}", message, args);
167-
}
168-
else
169-
{
170-
logger.LogInformation(exception, "{Message}", message);
166+
if (args.Length != 0)
167+
{
168+
logger.LogInformation(exception, "{Message} | Args: {Args}", message, args);
169+
}
170+
else
171+
{
172+
logger.LogInformation(exception, "{Message}", message);
173+
}
171174
}
172175
}
173176
}

0 commit comments

Comments
 (0)