winget-create
winget-create copied to clipboard
Provide an option to specify the log path
Description of the new feature / enhancement
When invoking wingetcreate
with automation, there may be an error that occurs and it would be helpful for the automation to output the log file to help diagnose the issue. The problem is that the invocation of the tool doesn't provide a way to explicitly set the log path. There does exist the default log location at %LocalAppData%\Packages\Microsoft.WindowsPackageManagerManifestCreator_8wekyb3d8bbwe\LocalState\DiagOutputDir which is useful for a human to get but it's not great for automation because:
- It requires explicitly hardcoding that path to look for the log file. This ties the automation to the implementation of the tool. If the tool changes its log location, then the automation would be broken.
- The log file name is generated with a timestamp so it's not known ahead of time what the name of the file will be.
Proposed technical implementation details
Include a -o,--log
option that allows a log file path to be set for any wingetcreate
command, just like the winget
CLI has.