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

Added --logging-level arg #248

Merged
merged 3 commits into from
Nov 1, 2023
Merged

Added --logging-level arg #248

merged 3 commits into from
Nov 1, 2023

Conversation

anmenaga
Copy link
Collaborator

@anmenaga anmenaga commented Nov 1, 2023

PR Summary

This PR adds --logging-level / -l arg that specifies the level of tracing messages printed to stderr.

   Error,
   Warning,
   Info,
   Debug,
   Trace

A value from this list will also enable all above levels; for example "--logging-level Debug" will enable Error, Warning, Info and Debug.

Help Example:

PS C:\DSCv3> dsc --help                                   
...
Options:
  ...
  -l, --logging-level <LOGGING_LEVEL>  Log level to display [default: Info] [possible values: error, warning, info, debug, trace]
...

Usage example:

PS C:\DSCv3> dsc -l debug resource get -r Microsoft/OSInfo
  2023-11-01T17:18:53.142033Z DEBUG dsc_lib::discovery::command_discovery: Found Microsoft/OSInfo in C:\DSCv3\bin\debug\osinfo.dsc.resource.json
    at C:\DSCv3\dsc_lib\src\discovery\command_discovery.rs:86

  2023-11-01T17:18:53.142987Z DEBUG dsc::resource_command: resource.type_name - Microsoft/OSInfo implemented_as - Command
    at src\resource_command.rs:27

  2023-11-01T17:18:53.143721Z  INFO dsc_lib::dscresources::command_resource: Invoking get Microsoft/OSInfo using osinfo
    at C:\DSCv3\dsc_lib\src\dscresources\command_resource.rs:50

  2023-11-01T17:18:53.144443Z DEBUG dsc_lib::dscresources::command_resource: Invoking command osinfo with args None
    at C:\DSCv3\dsc_lib\src\dscresources\command_resource.rs:412

actualState:
  $id: https://developer.microsoft.com/json-schemas/dsc/os_info/20230303/Microsoft.Dsc.OS_Info.schema.json
  family: Windows
  version: 10.0.22631
  edition: Windows 11 Enterprise
  bitness: '64'

dsc/src/args.rs Outdated Show resolved Hide resolved
@anmenaga anmenaga changed the title Added --debug arg Added --logging-level arg Nov 1, 2023
dsc/src/args.rs Outdated Show resolved Hide resolved
@anmenaga anmenaga added this pull request to the merge queue Nov 1, 2023
Merged via the queue into PowerShell:main with commit 84d0277 Nov 1, 2023
4 checks passed
@anmenaga anmenaga deleted the debug_arg branch November 1, 2023 18:38
@anmenaga anmenaga restored the debug_arg branch November 1, 2023 18:39
@anmenaga anmenaga deleted the debug_arg branch November 1, 2023 18:39
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Nov 8, 2023
This change documents the new `-l` / `--logging-level` option
added to the `dsc` command in PowerShell#248 and updates the changelog.
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Nov 14, 2023
This change documents the new `-l` / `--logging-level` option
added to the `dsc` command in PowerShell#248 and updates the changelog.
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.

2 participants