How to use the @azure/ms-rest-js.HttpPipelineLogLevel.INFO function in @azure/ms-rest-js

To help you get started, we’ve selected a few @azure/ms-rest-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / storage / storage-policies / LoggingPolicy.ts View on Github external
if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) {
      safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****");
    }
    this.log(
      HttpPipelineLogLevel.INFO,
      `'${safeURL}'==> OUTGOING REQUEST (Try number=${this.tryCount}).`
    );

    try {
      const response = await this._nextPolicy.sendRequest(request);

      const requestEndTime = new Date();
      const requestCompletionTime = requestEndTime.getTime() - this.requestStartTime.getTime();
      const operationDuration = requestEndTime.getTime() - this.operationStartTime.getTime();

      let currentLevel: HttpPipelineLogLevel = HttpPipelineLogLevel.INFO;
      let logMessage: string = "";
      if (this.shouldLog(HttpPipelineLogLevel.INFO)) {
        // Assume success and default to informational logging.
        logMessage = "Successfully Received Response. ";
      }

      // If the response took too long, we'll upgrade to warning.
      if (requestCompletionTime >= this.loggingOptions.logWarningIfTryOverThreshold) {
        // Log a warning if the try duration exceeded the specified threshold.
        if (this.shouldLog(HttpPipelineLogLevel.WARNING)) {
          currentLevel = HttpPipelineLogLevel.WARNING;
          logMessage = `SLOW OPERATION. Duration > ${
            this.loggingOptions.logWarningIfTryOverThreshold
          } ms. `;
        }
      }
github Azure / azure-sdk-for-js / sdk / storage / storage-policies / LoggingPolicy.ts View on Github external
}
    this.log(
      HttpPipelineLogLevel.INFO,
      `'${safeURL}'==> OUTGOING REQUEST (Try number=${this.tryCount}).`
    );

    try {
      const response = await this._nextPolicy.sendRequest(request);

      const requestEndTime = new Date();
      const requestCompletionTime = requestEndTime.getTime() - this.requestStartTime.getTime();
      const operationDuration = requestEndTime.getTime() - this.operationStartTime.getTime();

      let currentLevel: HttpPipelineLogLevel = HttpPipelineLogLevel.INFO;
      let logMessage: string = "";
      if (this.shouldLog(HttpPipelineLogLevel.INFO)) {
        // Assume success and default to informational logging.
        logMessage = "Successfully Received Response. ";
      }

      // If the response took too long, we'll upgrade to warning.
      if (requestCompletionTime >= this.loggingOptions.logWarningIfTryOverThreshold) {
        // Log a warning if the try duration exceeded the specified threshold.
        if (this.shouldLog(HttpPipelineLogLevel.WARNING)) {
          currentLevel = HttpPipelineLogLevel.WARNING;
          logMessage = `SLOW OPERATION. Duration > ${
            this.loggingOptions.logWarningIfTryOverThreshold
          } ms. `;
        }
      }

      if (
github Azure / azure-sdk-for-js / sdk / storage / storage-policies / LoggingPolicy.ts View on Github external
public async sendRequest(request: WebResource): Promise {
    this.tryCount++;
    this.requestStartTime = new Date();
    if (this.tryCount === 1) {
      this.operationStartTime = this.requestStartTime;
    }

    let safeURL: string = request.url;
    if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) {
      safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****");
    }
    this.log(
      HttpPipelineLogLevel.INFO,
      `'${safeURL}'==> OUTGOING REQUEST (Try number=${this.tryCount}).`
    );

    try {
      const response = await this._nextPolicy.sendRequest(request);

      const requestEndTime = new Date();
      const requestCompletionTime = requestEndTime.getTime() - this.requestStartTime.getTime();
      const operationDuration = requestEndTime.getTime() - this.operationStartTime.getTime();

      let currentLevel: HttpPipelineLogLevel = HttpPipelineLogLevel.INFO;
      let logMessage: string = "";
      if (this.shouldLog(HttpPipelineLogLevel.INFO)) {
        // Assume success and default to informational logging.
        logMessage = "Successfully Received Response. ";
      }