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

Enable way for resources and dsc.exe to provide verbose/debug information #89

Closed
SteveL-MSFT opened this issue Jun 21, 2023 · 2 comments · Fixed by #287
Closed

Enable way for resources and dsc.exe to provide verbose/debug information #89

SteveL-MSFT opened this issue Jun 21, 2023 · 2 comments · Fixed by #287
Assignees
Labels
Issue-Enhancement The issue is a feature or idea

Comments

@SteveL-MSFT
Copy link
Member

SteveL-MSFT commented Jun 21, 2023

Summary of the new feature / enhancement

Do we need both verbose and debug? Maybe start with just verbose.
Have a well defined JSONLINE schema for resources to output verbose information. Do we need to a way to turn on verbose for commands or just have it write it all the time and we throw it away if the user hasn't specified dsc --verbose?
What schema makes sense? Perhaps:

resourceType: <type name of the resource>
name: <friendly name if there are multiple instances of resources in config>
message: <open text>
timestamp: <filled in by dsc.exe>

It probably makes sense that resources only return the verbose message itself and dsc.exe fills in the rest. So an example JSON from a resource going to stderr could look like:

{
  "verbose": "this is my verbose message"
}
@SteveL-MSFT SteveL-MSFT added the Issue-Enhancement The issue is a feature or idea label Jun 21, 2023
@michaeltlombardi
Copy link
Collaborator

To be clear, the resource is required to emit to stderr like:

{ "<kind>": "<message>" }

So DSC distinguishes between verbose/debug/error messages, or always verbose as the key? What should DSC do with returned output that is non-JSON? Always treat non-JSON on stderr as error messages, or ignore them?

In the initial contract, are we only expecting/handling single string messages?

@anmenaga anmenaga self-assigned this Jun 27, 2023
@SteveL-MSFT
Copy link
Member Author

dsc.exe already knows if being used interactive (TTY exists) vs automation (redirected stdout) so it can emit verbose messages by default if used interactively, but suppress them if automated and have switches to explicitly control the behavior. Although resources emit JSON, dsc.exe should display them as rendered text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants