mirror of
https://github.com/azure/login.git
synced 2026-06-07 19:47:09 +00:00
* Bump lodash from 4.17.15 to 4.17.19 (#52) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * Bump @actions/core from 1.1.3 to 1.2.6 (#60) Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.1.3 to 1.2.6. - [Release notes](https://github.com/actions/toolkit/releases) - [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * updating node_nodules * updated package-lock Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
62 lines
2 KiB
JavaScript
62 lines
2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var cache_getters_1 = require("../utils/cache-getters");
|
|
var LogLevels = cache_getters_1.cacheGetters({
|
|
trace: 10,
|
|
debug: 20,
|
|
info: 30,
|
|
warn: 40,
|
|
error: 50,
|
|
fatal: 60,
|
|
get lower() {
|
|
return LogLevels.trace;
|
|
},
|
|
get higher() {
|
|
return LogLevels.fatal;
|
|
},
|
|
}, 'lower', 'higher');
|
|
exports.LogLevels = LogLevels;
|
|
var LogLevelNames = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];
|
|
exports.LogLevelNames = LogLevelNames;
|
|
var LogLevelValues = LogLevelNames.map(function (name) { return LogLevels[name]; });
|
|
exports.LogLevelValues = LogLevelValues;
|
|
var LogLevelsScale = LogLevelNames.map(function (name, index, _a) {
|
|
var length = _a.length;
|
|
var first = index === 0;
|
|
var last = index === length - 1;
|
|
var from = first ? -Infinity : LogLevelValues[index];
|
|
var next = last ? +Infinity : LogLevelValues[index + 1];
|
|
var test;
|
|
if (first) {
|
|
test = function (level) { return level < next; };
|
|
}
|
|
else if (last) {
|
|
test = function (level) { return level >= from; };
|
|
}
|
|
else {
|
|
test = function (level) { return level < next && level >= from; };
|
|
}
|
|
return { range: { from: from, next: next }, name: name, test: test };
|
|
});
|
|
exports.LogLevelsScale = LogLevelsScale;
|
|
var logLevelNameFor = function (level) {
|
|
if (level == null || isNaN(level)) {
|
|
return LogLevelNames[0];
|
|
}
|
|
return LogLevelsScale.find(function (_a) {
|
|
var test = _a.test;
|
|
return test(level);
|
|
}).name;
|
|
};
|
|
exports.logLevelNameFor = logLevelNameFor;
|
|
var parseLogLevel = function (level) {
|
|
if (typeof level === 'string') {
|
|
level = level.toLowerCase();
|
|
if (level in LogLevels) {
|
|
return LogLevels[level];
|
|
}
|
|
return /^\s*[0-9]+\s*$/.test(level) ? parseInt(level.trim(), 10) : undefined;
|
|
}
|
|
return typeof level === 'number' && !isNaN(level) ? +level : undefined;
|
|
};
|
|
exports.parseLogLevel = parseLogLevel;
|