Azure / Azure/azure-functions-powershell-worker
Add `Write-AzFuncLog` cmdlet to the helper module to allow writing Azure Function user logs in an explicit way.
- Dominant language
- C#
- Stars
- 215
- Forks
- 61
- Avg merge
- 21h 4m
- Merged PRs (30d)
- 6
Description
This is a feedback from the tech review within PowerShell team.
Currently PowerShell built-in `Write-*` cmdlets are redirected to the Azure Function log in the following mapping:
Write-* cmdlet (the target stream) | Log level
-- | --
Write-Verbose (verbose stream) | Trace
Write-Progress (progress stream) | Trace
Write-Debug (debug stream) | Debug
Write-Information (information stream) | Information
Write-Host (information stream) | Information
Write-Warning (warning stream) | Warning
Write-Error (error stream) | Error
Write-Output (output stream) | Information
The log level `Critical` doesn't have a corresponding mapping, and for `Verbose`, `Progress`, `Host`, and `Output`, it's not obvious for users to tell what log levels they are mapped to.
So the feedback is to provide another cmdlet to allow writing Azure Function user logs in an explicit way.
The proposal is `Write-AzFuncLog`, with the following syntax:
```
Write-AzFuncLog [-Message] [-Level] []
```
As for the implementation, probably it should just call `Write-Information -Tag` internally with the log level as the tag.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.