@@ -128,10 +128,13 @@ CancellationToken cancellationToken
128
128
var context = result . OpenApiDiagnostic ;
129
129
if ( context . Errors . Count > 0 )
130
130
{
131
+ logger . LogTrace ( "{timestamp}ms: Parsed OpenAPI with errors. {count} paths found." , stopwatch . ElapsedMilliseconds , document . Paths . Count ) ;
132
+
131
133
var errorReport = new StringBuilder ( ) ;
132
134
133
135
foreach ( var error in context . Errors )
134
136
{
137
+ logger . LogError ( "OpenApi Parsing error: {message}" , error . ToString ( ) ) ;
135
138
errorReport . AppendLine ( error . ToString ( ) ) ;
136
139
}
137
140
logger . LogError ( $ "{ stopwatch . ElapsedMilliseconds } ms: OpenApi Parsing errors { string . Join ( Environment . NewLine , context . Errors . Select ( e => e . Message ) . ToArray ( ) ) } ") ;
@@ -282,9 +285,9 @@ private static async Task<Stream> GetStream(string input, ILogger logger, Cancel
282
285
catch ( HttpRequestException ex )
283
286
{
284
287
#if DEBUG
285
- logger . LogCritical ( ex , $ "Could not download the file at { input } , reason: { ex . Message } " ) ;
288
+ logger . LogCritical ( ex , "Could not download the file at {inputPath }, reason: {exMessage}" , input , ex . Message ) ;
286
289
#else
287
- logger . LogCritical ( $ "Could not download the file at { input } , reason: { ex . Message } ", input , ex . Message ) ;
290
+ logger . LogCritical ( "Could not download the file at {inputPath }, reason: {exMessage }" , input , ex . Message ) ;
288
291
#endif
289
292
return null ;
290
293
}
@@ -305,9 +308,9 @@ ex is SecurityException ||
305
308
ex is NotSupportedException )
306
309
{
307
310
#if DEBUG
308
- logger . LogCritical ( ex , $ "Could not open the file at { input } , reason: { ex . Message } " ) ;
311
+ logger . LogCritical ( ex , "Could not open the file at {inputPath }, reason: {exMessage}" , input , ex . Message ) ;
309
312
#else
310
- logger . LogCritical ( $ "Could not open the file at { input } , reason: { ex . Message } " ) ;
313
+ logger . LogCritical ( "Could not open the file at {inputPath }, reason: {exMessage}" , input , ex . Message ) ;
311
314
#endif
312
315
return null ;
313
316
}
0 commit comments