Skip to content

Remove WriteVerbose statement from ConvertTo-Json - #7487

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
devblackops:fix/converttojson-verbose
Aug 10, 2018
Merged

Remove WriteVerbose statement from ConvertTo-Json#7487
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
devblackops:fix/converttojson-verbose

Conversation

@devblackops

@devblackops Brandon Olin (devblackops) commented Aug 9, 2018

Copy link
Copy Markdown
Contributor

PR Summary

Fix #7486.

In PR #6392, a WriteVerbose statement was added to ConvertTo-Json which I feel is unnecessary. On large or complex objects being serialized to json, this produces a ton of verbose messages which isn't adding any value to the end user. This PR removes that statement.

PR Checklist

@iSazonov

Copy link
Copy Markdown
Collaborator

Brandon Olin (@devblackops) I wonder do you see the verbose messages without -Verbose ?

@markekraus Mark Kraus (markekraus) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brandon Olin (@devblackops) Please also remove the message string which would no longer be used after this pr:

<data name="ConvertToJsonProcessValueVerboseMessage" xml:space="preserve">
<value>Processing object of type [{0}] at depth {1}</value>
</data>

@devblackops

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) The messages aren't shown without -Verbose but often will be inherited from cmdlets/functions that invoke ConvertFrom-Json that do have -Verbose specified.

It's easy enough to suppress the verbose output with -Verbose:False or set it via $PSDefaultParameterValues but in this case, these messages aren't really adding any value, hence the PR to remove them.

@devblackops

Copy link
Copy Markdown
Contributor Author

Mark Kraus (@markekraus) I pushed a commit to remove the resource string.

@dantraMSFT Dan Travison (dantraMSFT) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the verbose statement doesn't add much value.

It was added when StopProcessing was added so I expect it was done for debugging purposes.

@markekraus Mark Kraus (markekraus) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 8374a5c into PowerShell:master Aug 10, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

Brandon Olin (@devblackops) Thanks for your contribution!

xtqqczze added a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Jan 14, 2019
@xtqqczze xtqqczze mentioned this pull request Jan 14, 2019
11 tasks
@devblackops
Brandon Olin (devblackops) deleted the fix/converttojson-verbose branch January 15, 2019 21:41
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
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.

Remove unnecessary verbose message from ConvertTo-Json

5 participants