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

Support for resource tracing info #287

Merged
merged 7 commits into from
Mar 13, 2024

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Dec 1, 2023

PR Summary

Fix #89

This is a basic support for resources and resource providers to push their diagnostic info to the log of dsc.exe.

Contract is:
If a resource/provider wants to submit a diagnostic message to the DSC, it has to format the message as JSON string with "Error"/"Warning"/"Info"/"Debug"/"Trace" field and publish it to the STDERR stream.
For example:
{"Trace":"PSPath=c:\PowerShell-7.3.1-win-x64"}

Strings in the STDERR that are not a valid JSON are ignored (unless exit code is non-zero);

Note:
Timestamps currently show the time when dsc receives all output when resource process completes. Timestamps will become accurate (i.e. will show exact time when they are generated by a resource/provider) once #46 is done.

Example:
q2

dsc_lib/src/dscresources/command_resource.rs Outdated Show resolved Hide resolved
dsc_lib/src/dscresources/command_resource.rs Outdated Show resolved Hide resolved
@anmenaga
Copy link
Collaborator Author

anmenaga commented Mar 7, 2024

Updated PR Summary to be accurate to latest changes.

@anmenaga anmenaga added this pull request to the merge queue Mar 13, 2024
Merged via the queue into PowerShell:main with commit aa3d968 Mar 13, 2024
4 checks passed
@anmenaga anmenaga deleted the resource_debug_msgs branch March 13, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable way for resources and dsc.exe to provide verbose/debug information
2 participants