TelemetryPolicy class

TelemetryPolicy 是用來標記每個要求之使用者代理程序標頭的原則。

Extends

BaseRequestPolicy

建構函式

TelemetryPolicy(RequestPolicy, RequestPolicyOptions, string)

建立 TelemetryPolicy 的實例。

屬性

telemetry

遙測字串。

方法

log(HttpPipelineLogLevel, string)

嘗試將提供的訊息記錄至提供的記錄器。 如果未提供記錄器,或記錄層級未將記錄器閾值肉化,則不會記錄任何記錄器。

sendRequest(WebResource)

傳送要求。

shouldLog(HttpPipelineLogLevel)

取得是否應該記錄具有所提供記錄層級的記錄檔。

建構函式詳細資料

TelemetryPolicy(RequestPolicy, RequestPolicyOptions, string)

建立 TelemetryPolicy 的實例。

new TelemetryPolicy(nextPolicy: RequestPolicy, options: RequestPolicyOptions, telemetry: string)

參數

nextPolicy

RequestPolicy

options

RequestPolicyOptions

telemetry

string

屬性詳細資料

telemetry

遙測字串。

telemetry: string

屬性值

string

方法詳細資料

log(HttpPipelineLogLevel, string)

嘗試將提供的訊息記錄至提供的記錄器。 如果未提供記錄器,或記錄層級未將記錄器閾值肉化,則不會記錄任何記錄器。

function log(logLevel: HttpPipelineLogLevel, message: string)

參數

logLevel

HttpPipelineLogLevel

此記錄檔的記錄層級。

message

string

此記錄檔的訊息。

sendRequest(WebResource)

傳送要求。

function sendRequest(request: WebResource)

參數

request

WebResource

傳回

Promise<HttpOperationResponse>

shouldLog(HttpPipelineLogLevel)

取得是否應該記錄具有所提供記錄層級的記錄檔。

function shouldLog(logLevel: HttpPipelineLogLevel)

參數

logLevel

HttpPipelineLogLevel

將記錄的記錄檔層級。

傳回

boolean

是否應該記錄具有所提供記錄層級的記錄檔。