-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed issues related to merge conflicts #791
Conversation
await rootCommand.InvokeAsync(args); | ||
|
||
//// Wait for logger to write messages to the console before exiting | ||
await Task.Delay(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This delay was necessary to ensure there was time for log messages to get written to the console.
@@ -35,7 +36,7 @@ static async Task<int> Main(string[] args) | |||
var formatOption = new Option<OpenApiFormat?>("--format", "File format"); | |||
formatOption.AddAlias("-f"); | |||
|
|||
var logLevelOption = new Option<LogLevel>("--loglevel", () => LogLevel.Warning, "The log level to use when logging messages to the main output."); | |||
var logLevelOption = new Option<LogLevel>("--loglevel", () => LogLevel.Information, "The log level to use when logging messages to the main output."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the default so that logs at the Information level will be showed by default. Without this the stats output by the validate are not shown by default.
@@ -11,7 +12,7 @@ namespace Microsoft.OpenApi.Hidi | |||
{ | |||
static class Program | |||
{ | |||
static async Task<int> Main(string[] args) | |||
static async Task Main(string[] args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the docs for System.CommandLine this isn't necessary.
|
||
stream = await GetStream(csdl, logger, cancellationToken); | ||
document = await ConvertCsdlToOpenApi(stream); | ||
using (logger.BeginScope($"Convert CSDL: {csdl}", csdl)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the BeginScope call to provide context to the logging messages.
Some of the logic around default versions got broken during the merging to vnext.
Also, the mysteriously missing error messages was caused by a timing issue where the console application would shut down before the message got written to the console. By adding a 10ms delay on shutdown, the console has time to write the message out.