Skip to content

Added --logging-level arg#248

Merged
anmenaga merged 3 commits intoPowerShell:mainfrom
anmenaga:debug_arg
Nov 1, 2023
Merged

Added --logging-level arg#248
anmenaga merged 3 commits intoPowerShell:mainfrom
anmenaga:debug_arg

Conversation

@anmenaga
Copy link
Copy Markdown

@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'

@anmenaga anmenaga changed the title Added --debug arg Added --logging-level arg Nov 1, 2023
@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
@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