-
Notifications
You must be signed in to change notification settings - Fork 54
Enabled command line trace option #516
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
base: main
Are you sure you want to change the base?
Enabled command line trace option #516
Conversation
| { | ||
| [Option('t', "trace", Required = false, Default = false, | ||
| HelpText = "Enable trace-level logging")] | ||
| public bool EnableTraceLogging { get; set; } |
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.
You've added an option to enable trace logging to the BaseToolOptions which is used by most, if not all, commands in OSSGadget. However, your change only enables trace logging for the DownloadTool. This will be confusing for users.
Suggestions
-
Allow the user to specify the log level using either string or numeric values. See nlog log levels and CommandLineParser docs
-
The log level configuration should be respected across all commands. Ideally this logic isn't distributed across the commands (perhaps in
BaseTool?)
|
Based on the output in the PR description, the full URL for the downloaded file isn't in the trace output either. It looks like we need another log statement. I'd expect to see output with something like: |
Refactored logging in `BaseTool.cs` to support various log levels with a new `ParseLogLevel` method, allowing both string and numeric inputs. Updated `BaseToolOptions.cs` to replace `EnableTraceLogging` with a more flexible `LogLevel` option. Introduced `LogDownload` method in `BaseProjectManager.cs` to streamline logging of download operations, replacing repetitive code across multiple project manager classes. This enhances code consistency, maintainability, and readability.
|
Updated log messages
Copilot generated: This pull request introduces an option to enable trace-level logging for CLI tools, improving debugging and visibility into tool execution. The main change is the addition of a new command-line option and the associated logic to configure logging based on user input. Logging enhancements:
|
|
/azp run |
|
Commenter does not have sufficient privileges for PR 516 in repo microsoft/OSSGadget |

Enabled command line trace logging option to print the package URL during download.
Changes:
Output
