Skip to content
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

Merged
merged 4 commits into from
Mar 15, 2022
Merged

Fixed issues related to merge conflicts #791

merged 4 commits into from
Mar 15, 2022

Conversation

darrelmiller
Copy link
Member

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.

await rootCommand.InvokeAsync(args);

//// Wait for logger to write messages to the console before exiting
await Task.Delay(10);
Copy link
Member Author

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.");
Copy link
Member Author

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)
Copy link
Member Author

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))
Copy link
Member Author

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.

@darrelmiller darrelmiller merged commit 3b0c720 into vnext Mar 15, 2022
@darrelmiller darrelmiller deleted the dm/fixmerge branch March 15, 2022 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants