Enabled command line trace option#516
Enabled command line trace option#516vamsipolavarapu-msft wants to merge 2 commits intomicrosoft:mainfrom
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.
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
