Permalink
Cannot retrieve contributors at this time
35 lines (35 sloc)
1.16 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/@azure/core-http/dist-esm/src/httpPipelineLogger.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Corporation. | |
// Licensed under the MIT license. | |
import { HttpPipelineLogLevel } from "./httpPipelineLogLevel"; | |
/** | |
* A HttpPipelineLogger that will send its logs to the console. | |
*/ | |
export class ConsoleHttpPipelineLogger { | |
/** | |
* Create a new ConsoleHttpPipelineLogger. | |
* @param minimumLogLevel - The log level threshold for what logs will be logged. | |
*/ | |
constructor(minimumLogLevel) { | |
this.minimumLogLevel = minimumLogLevel; | |
} | |
/** | |
* Log the provided message. | |
* @param logLevel - The HttpLogDetailLevel associated with this message. | |
* @param message - The message to log. | |
*/ | |
log(logLevel, message) { | |
const logMessage = `${HttpPipelineLogLevel[logLevel]}: ${message}`; | |
switch (logLevel) { | |
case HttpPipelineLogLevel.ERROR: | |
console.error(logMessage); | |
break; | |
case HttpPipelineLogLevel.WARNING: | |
console.warn(logMessage); | |
break; | |
case HttpPipelineLogLevel.INFO: | |
console.log(logMessage); | |
break; | |
} | |
} | |
} | |
//# sourceMappingURL=httpPipelineLogger.js.map |