Skip to content

Add Write-AzFuncLog cmdlet to the helper module to allow writing Azure Function user logs in an explicit way. #162

Open
@daxian-dbw

Description

@daxian-dbw

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] <string> [-Level] <string> [<CommonParameters>]

As for the implementation, probably it should just call Write-Information -Tag internally with the log level as the tag.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions