standard-log 11.5.2 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/cjs/console.js +4 -4
- package/cjs/console.js.map +1 -1
- package/cjs/formatter.js +2 -2
- package/cjs/formatter.js.map +1 -1
- package/cjs/index.d.ts +4 -4
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +7 -8
- package/cjs/index.js.map +1 -1
- package/cjs/{logLevels.d.ts → log_levels.d.ts} +1 -1
- package/cjs/log_levels.d.ts.map +1 -0
- package/cjs/{logLevels.js → log_levels.js} +1 -1
- package/{esm/logLevels.js.map → cjs/log_levels.js.map} +1 -1
- package/{esm/logStore.d.ts → cjs/log_store.d.ts} +1 -1
- package/cjs/log_store.d.ts.map +1 -0
- package/cjs/{logStore.js → log_store.js} +6 -6
- package/cjs/log_store.js.map +1 -0
- package/cjs/logger.d.ts +1 -1
- package/cjs/logger.d.ts.map +1 -1
- package/cjs/logger.js +3 -3
- package/cjs/logger.js.map +1 -1
- package/cjs/{standardLog.ctx.d.ts → standard_log.ctx.d.ts} +2 -2
- package/cjs/standard_log.ctx.d.ts.map +1 -0
- package/cjs/{standardLog.ctx.js → standard_log.ctx.js} +1 -1
- package/cjs/standard_log.ctx.js.map +1 -0
- package/{esm/standardLog.d.ts → cjs/standard_log.d.ts} +3 -8
- package/cjs/standard_log.d.ts.map +1 -0
- package/cjs/{standardLog.js → standard_log.js} +20 -28
- package/cjs/standard_log.js.map +1 -0
- package/cjs/standard_log.mocks.d.ts +8 -0
- package/cjs/standard_log.mocks.d.ts.map +1 -0
- package/cjs/standard_log.mocks.js +32 -0
- package/cjs/standard_log.mocks.js.map +1 -0
- package/cjs/testing/index.d.ts +2 -0
- package/cjs/testing/index.d.ts.map +1 -0
- package/cjs/testing/index.js +6 -0
- package/cjs/testing/index.js.map +1 -0
- package/dist/standard-log.es5.js +56 -65
- package/dist/standard-log.es5.js.gz +0 -0
- package/dist/standard-log.es5.js.map +1 -1
- package/dist/standard-log.es5.js.map.gz +0 -0
- package/dist/standard-log.esm.js +58 -67
- package/dist/standard-log.esm.js.gz +0 -0
- package/dist/standard-log.esm.js.map +1 -1
- package/dist/standard-log.esm.js.map.gz +0 -0
- package/esm/console.js +1 -1
- package/esm/console.js.map +1 -1
- package/esm/formatter.js +1 -1
- package/esm/formatter.js.map +1 -1
- package/esm/index.d.ts +4 -4
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/{logLevels.d.ts → log_levels.d.ts} +1 -1
- package/esm/log_levels.d.ts.map +1 -0
- package/esm/{logLevels.js → log_levels.js} +1 -1
- package/esm/log_levels.js.map +1 -0
- package/{cjs/logStore.d.ts → esm/log_store.d.ts} +1 -1
- package/esm/log_store.d.ts.map +1 -0
- package/esm/{logStore.js → log_store.js} +2 -2
- package/esm/log_store.js.map +1 -0
- package/esm/logger.d.ts +1 -1
- package/esm/logger.d.ts.map +1 -1
- package/esm/logger.js +1 -1
- package/esm/logger.js.map +1 -1
- package/esm/{standardLog.ctx.d.ts → standard_log.ctx.d.ts} +2 -2
- package/esm/standard_log.ctx.d.ts.map +1 -0
- package/esm/{standardLog.ctx.js → standard_log.ctx.js} +1 -1
- package/esm/standard_log.ctx.js.map +1 -0
- package/{cjs/standardLog.d.ts → esm/standard_log.d.ts} +3 -8
- package/esm/standard_log.d.ts.map +1 -0
- package/esm/{standardLog.js → standard_log.js} +4 -10
- package/esm/standard_log.js.map +1 -0
- package/esm/standard_log.mocks.d.ts +8 -0
- package/esm/standard_log.mocks.d.ts.map +1 -0
- package/esm/standard_log.mocks.js +16 -0
- package/esm/standard_log.mocks.js.map +1 -0
- package/esm/testing/index.d.ts +2 -0
- package/esm/testing/index.d.ts.map +1 -0
- package/esm/testing/index.js +2 -0
- package/esm/testing/index.js.map +1 -0
- package/package.json +8 -7
- package/testing/index.d.ts +1 -0
- package/testing/index.js +1 -0
- package/ts/console.ts +1 -1
- package/ts/formatter.ts +1 -1
- package/ts/index.ts +5 -11
- package/ts/{logStore.ts → log_store.ts} +1 -1
- package/ts/logger.ts +2 -2
- package/ts/{standardLog.ctx.ts → standard_log.ctx.ts} +1 -1
- package/ts/standard_log.mocks.ts +22 -0
- package/ts/{standardLog.ts → standard_log.ts} +4 -18
- package/ts/testing/index.ts +1 -0
- package/cjs/logLevels.d.ts.map +0 -1
- package/cjs/logLevels.js.map +0 -1
- package/cjs/logStore.d.ts.map +0 -1
- package/cjs/logStore.js.map +0 -1
- package/cjs/standardLog.ctx.d.ts.map +0 -1
- package/cjs/standardLog.ctx.js.map +0 -1
- package/cjs/standardLog.d.ts.map +0 -1
- package/cjs/standardLog.js.map +0 -1
- package/esm/logLevels.d.ts.map +0 -1
- package/esm/logStore.d.ts.map +0 -1
- package/esm/logStore.js.map +0 -1
- package/esm/standardLog.ctx.d.ts.map +0 -1
- package/esm/standardLog.ctx.js.map +0 -1
- package/esm/standardLog.d.ts.map +0 -1
- package/esm/standardLog.js.map +0 -1
- /package/ts/{logLevels.ts → log_levels.ts} +0 -0
package/dist/standard-log.es5.js
CHANGED
|
@@ -5824,18 +5824,18 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5824
5824
|
exports.createConsoleLogReporter = exports.toConsoleMethod = void 0;
|
|
5825
5825
|
var type_plus_1 = __webpack_require__(/*! type-plus */ "../../node_modules/.pnpm/type-plus@6.5.0/node_modules/type-plus/cjs/index.js");
|
|
5826
5826
|
var formatter_js_1 = __webpack_require__(/*! ./formatter.js */ "./ts/formatter.ts");
|
|
5827
|
-
var
|
|
5827
|
+
var log_levels_js_1 = __webpack_require__(/*! ./log_levels.js */ "./ts/log_levels.ts");
|
|
5828
5828
|
var platform_js_1 = __webpack_require__(/*! ./platform.js */ "./ts/platform.browser.ts");
|
|
5829
5829
|
function toConsoleMethod(level) {
|
|
5830
5830
|
switch (true) {
|
|
5831
5831
|
// edge case in case none is somehow written
|
|
5832
5832
|
case level <= 0:
|
|
5833
5833
|
return 'debug';
|
|
5834
|
-
case level <=
|
|
5834
|
+
case level <= log_levels_js_1.logLevels.error:
|
|
5835
5835
|
return 'error';
|
|
5836
|
-
case level <=
|
|
5836
|
+
case level <= log_levels_js_1.logLevels.warn:
|
|
5837
5837
|
return 'warn';
|
|
5838
|
-
case level <=
|
|
5838
|
+
case level <= log_levels_js_1.logLevels.info:
|
|
5839
5839
|
return 'info';
|
|
5840
5840
|
default:
|
|
5841
5841
|
return 'debug';
|
|
@@ -5988,7 +5988,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5988
5988
|
exports.consoleFormatter = exports.plainLogFormatter = exports.formatLogLevel = exports.createTimestampFormatter = void 0;
|
|
5989
5989
|
var ms_1 = __importDefault(__webpack_require__(/*! ms */ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"));
|
|
5990
5990
|
var upper_case_1 = __webpack_require__(/*! upper-case */ "../../node_modules/.pnpm/upper-case@2.0.2/node_modules/upper-case/dist/index.js");
|
|
5991
|
-
var
|
|
5991
|
+
var log_levels_js_1 = __webpack_require__(/*! ./log_levels.js */ "./ts/log_levels.ts");
|
|
5992
5992
|
function createTimestampFormatter(format) {
|
|
5993
5993
|
switch (format) {
|
|
5994
5994
|
case 'none':
|
|
@@ -6008,7 +6008,7 @@ function createTimestampFormatter(format) {
|
|
|
6008
6008
|
}
|
|
6009
6009
|
exports.createTimestampFormatter = createTimestampFormatter;
|
|
6010
6010
|
function formatLogLevel(level) {
|
|
6011
|
-
return "(".concat((0, upper_case_1.upperCase)((0,
|
|
6011
|
+
return "(".concat((0, upper_case_1.upperCase)((0, log_levels_js_1.toLogLevelName)(level)), ")");
|
|
6012
6012
|
}
|
|
6013
6013
|
exports.formatLogLevel = formatLogLevel;
|
|
6014
6014
|
/**
|
|
@@ -6057,26 +6057,25 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
6057
6057
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
6058
6058
|
};
|
|
6059
6059
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6060
|
-
exports.suppressLogs = exports.getLogger = exports.
|
|
6060
|
+
exports.suppressLogs = exports.getLogger = exports.createStandardLog = exports.configGlobal = void 0;
|
|
6061
6061
|
__exportStar(__webpack_require__(/*! ./console.js */ "./ts/console.ts"), exports);
|
|
6062
6062
|
__exportStar(__webpack_require__(/*! ./errors.js */ "./ts/errors.ts"), exports);
|
|
6063
6063
|
__exportStar(__webpack_require__(/*! ./formatter.js */ "./ts/formatter.ts"), exports);
|
|
6064
|
-
__exportStar(__webpack_require__(/*! ./
|
|
6064
|
+
__exportStar(__webpack_require__(/*! ./log_levels.js */ "./ts/log_levels.ts"), exports);
|
|
6065
6065
|
__exportStar(__webpack_require__(/*! ./memory.js */ "./ts/memory.ts"), exports);
|
|
6066
|
-
var
|
|
6067
|
-
Object.defineProperty(exports, "configGlobal", ({ enumerable: true, get: function () { return
|
|
6068
|
-
Object.defineProperty(exports, "createStandardLog", ({ enumerable: true, get: function () { return
|
|
6069
|
-
Object.defineProperty(exports, "
|
|
6070
|
-
Object.defineProperty(exports, "
|
|
6071
|
-
Object.defineProperty(exports, "suppressLogs", ({ enumerable: true, get: function () { return standardLog_js_1.suppressLogs; } }));
|
|
6066
|
+
var standard_log_js_1 = __webpack_require__(/*! ./standard_log.js */ "./ts/standard_log.ts");
|
|
6067
|
+
Object.defineProperty(exports, "configGlobal", ({ enumerable: true, get: function () { return standard_log_js_1.configGlobal; } }));
|
|
6068
|
+
Object.defineProperty(exports, "createStandardLog", ({ enumerable: true, get: function () { return standard_log_js_1.createStandardLog; } }));
|
|
6069
|
+
Object.defineProperty(exports, "getLogger", ({ enumerable: true, get: function () { return standard_log_js_1.getLogger; } }));
|
|
6070
|
+
Object.defineProperty(exports, "suppressLogs", ({ enumerable: true, get: function () { return standard_log_js_1.suppressLogs; } }));
|
|
6072
6071
|
|
|
6073
6072
|
|
|
6074
6073
|
/***/ }),
|
|
6075
6074
|
|
|
6076
|
-
/***/ "./ts/
|
|
6077
|
-
|
|
6078
|
-
!*** ./ts/
|
|
6079
|
-
|
|
6075
|
+
/***/ "./ts/log_levels.ts":
|
|
6076
|
+
/*!**************************!*\
|
|
6077
|
+
!*** ./ts/log_levels.ts ***!
|
|
6078
|
+
\**************************/
|
|
6080
6079
|
/***/ (function(__unused_webpack_module, exports) {
|
|
6081
6080
|
|
|
6082
6081
|
"use strict";
|
|
@@ -6202,10 +6201,10 @@ exports.DEFAULT_LOG_METHOD_NAMES = [
|
|
|
6202
6201
|
|
|
6203
6202
|
/***/ }),
|
|
6204
6203
|
|
|
6205
|
-
/***/ "./ts/
|
|
6206
|
-
|
|
6207
|
-
!*** ./ts/
|
|
6208
|
-
|
|
6204
|
+
/***/ "./ts/log_store.ts":
|
|
6205
|
+
/*!*************************!*\
|
|
6206
|
+
!*** ./ts/log_store.ts ***!
|
|
6207
|
+
\*************************/
|
|
6209
6208
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6210
6209
|
|
|
6211
6210
|
"use strict";
|
|
@@ -6214,7 +6213,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
6214
6213
|
exports.logLevelStore = exports.createLogStore = void 0;
|
|
6215
6214
|
var type_plus_1 = __webpack_require__(/*! type-plus */ "../../node_modules/.pnpm/type-plus@6.5.0/node_modules/type-plus/cjs/index.js");
|
|
6216
6215
|
var console_js_1 = __webpack_require__(/*! ./console.js */ "./ts/console.ts");
|
|
6217
|
-
var
|
|
6216
|
+
var log_levels_js_1 = __webpack_require__(/*! ./log_levels.js */ "./ts/log_levels.ts");
|
|
6218
6217
|
function createLogStore(options) {
|
|
6219
6218
|
return {
|
|
6220
6219
|
loggers: (0, type_plus_1.record)(),
|
|
@@ -6237,16 +6236,16 @@ function logLevelStore(options) {
|
|
|
6237
6236
|
return {
|
|
6238
6237
|
getName: function (level) {
|
|
6239
6238
|
var _a;
|
|
6240
|
-
return (_a = store.customLevelsReverse[level]) !== null && _a !== void 0 ? _a : (0,
|
|
6239
|
+
return (_a = store.customLevelsReverse[level]) !== null && _a !== void 0 ? _a : (0, log_levels_js_1.toLogLevelName)(level);
|
|
6241
6240
|
},
|
|
6242
6241
|
getLevel: function (name) {
|
|
6243
6242
|
var _a;
|
|
6244
|
-
return (_a = store.customLevels[name]) !== null && _a !== void 0 ? _a : (0,
|
|
6243
|
+
return (_a = store.customLevels[name]) !== null && _a !== void 0 ? _a : (0, log_levels_js_1.toLogLevel)(name);
|
|
6245
6244
|
},
|
|
6246
6245
|
getAllLevels: function () {
|
|
6247
|
-
return (0, type_plus_1.reduceKey)(
|
|
6246
|
+
return (0, type_plus_1.reduceKey)(log_levels_js_1.logLevels, function (result, name) {
|
|
6248
6247
|
if (name !== 'none' && name !== 'all')
|
|
6249
|
-
result.push({ name: name, level:
|
|
6248
|
+
result.push({ name: name, level: log_levels_js_1.logLevels[name] });
|
|
6250
6249
|
return result;
|
|
6251
6250
|
}, (0, type_plus_1.mapKey)(store.customLevels, function (name) { return ({ name: name, level: store.customLevels[name] }); }));
|
|
6252
6251
|
}
|
|
@@ -6276,7 +6275,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
6276
6275
|
};
|
|
6277
6276
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6278
6277
|
exports.createLogger = void 0;
|
|
6279
|
-
var
|
|
6278
|
+
var log_levels_js_1 = __webpack_require__(/*! ./log_levels.js */ "./ts/log_levels.ts");
|
|
6280
6279
|
function createLogger(store, id, options) {
|
|
6281
6280
|
var _a;
|
|
6282
6281
|
id = sanitizeId(id);
|
|
@@ -6305,10 +6304,10 @@ function createLogger(store, id, options) {
|
|
|
6305
6304
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
6306
6305
|
args[_i] = arguments[_i];
|
|
6307
6306
|
}
|
|
6308
|
-
if (shouldLog(store,
|
|
6307
|
+
if (shouldLog(store, log_levels_js_1.logLevels.debug, logger.level))
|
|
6309
6308
|
write({
|
|
6310
6309
|
id: id,
|
|
6311
|
-
level:
|
|
6310
|
+
level: log_levels_js_1.logLevels.debug,
|
|
6312
6311
|
args: __spreadArray([++counter], args, true),
|
|
6313
6312
|
timestamp: new Date()
|
|
6314
6313
|
});
|
|
@@ -6462,10 +6461,10 @@ exports.polyfill = (0, type_plus_1.record)();
|
|
|
6462
6461
|
|
|
6463
6462
|
/***/ }),
|
|
6464
6463
|
|
|
6465
|
-
/***/ "./ts/
|
|
6466
|
-
|
|
6467
|
-
!*** ./ts/
|
|
6468
|
-
|
|
6464
|
+
/***/ "./ts/standard_log.ctx.ts":
|
|
6465
|
+
/*!********************************!*\
|
|
6466
|
+
!*** ./ts/standard_log.ctx.ts ***!
|
|
6467
|
+
\********************************/
|
|
6469
6468
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6470
6469
|
|
|
6471
6470
|
"use strict";
|
|
@@ -6478,10 +6477,10 @@ exports.ctx = (0, type_plus_1.record)();
|
|
|
6478
6477
|
|
|
6479
6478
|
/***/ }),
|
|
6480
6479
|
|
|
6481
|
-
/***/ "./ts/
|
|
6482
|
-
|
|
6483
|
-
!*** ./ts/
|
|
6484
|
-
|
|
6480
|
+
/***/ "./ts/standard_log.ts":
|
|
6481
|
+
/*!****************************!*\
|
|
6482
|
+
!*** ./ts/standard_log.ts ***!
|
|
6483
|
+
\****************************/
|
|
6485
6484
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6486
6485
|
|
|
6487
6486
|
"use strict";
|
|
@@ -6498,13 +6497,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
6498
6497
|
return __assign.apply(this, arguments);
|
|
6499
6498
|
};
|
|
6500
6499
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6501
|
-
exports.configGlobal = exports.getLogger = exports.suppressLogs = exports.
|
|
6500
|
+
exports.configGlobal = exports.getLogger = exports.suppressLogs = exports.createStandardLogClosure = exports.createStandardLog = void 0;
|
|
6502
6501
|
var type_plus_1 = __webpack_require__(/*! type-plus */ "../../node_modules/.pnpm/type-plus@6.5.0/node_modules/type-plus/cjs/index.js");
|
|
6502
|
+
var log_levels_js_1 = __webpack_require__(/*! ./log_levels.js */ "./ts/log_levels.ts");
|
|
6503
|
+
var log_store_js_1 = __webpack_require__(/*! ./log_store.js */ "./ts/log_store.ts");
|
|
6503
6504
|
var logger_js_1 = __webpack_require__(/*! ./logger.js */ "./ts/logger.ts");
|
|
6504
|
-
var
|
|
6505
|
-
var logStore_js_1 = __webpack_require__(/*! ./logStore.js */ "./ts/logStore.ts");
|
|
6506
|
-
var memory_js_1 = __webpack_require__(/*! ./memory.js */ "./ts/memory.ts");
|
|
6507
|
-
var standardLog_ctx_js_1 = __webpack_require__(/*! ./standardLog.ctx.js */ "./ts/standardLog.ctx.ts");
|
|
6505
|
+
var standard_log_ctx_js_1 = __webpack_require__(/*! ./standard_log.ctx.js */ "./ts/standard_log.ctx.ts");
|
|
6508
6506
|
function createStandardLog(options) {
|
|
6509
6507
|
var _a;
|
|
6510
6508
|
var closure = createStandardLogClosure(options);
|
|
@@ -6512,8 +6510,8 @@ function createStandardLog(options) {
|
|
|
6512
6510
|
var log = closure.standardLog.getLogger('standard-log');
|
|
6513
6511
|
log.critical("Detected reporter with empty id. This is not allowed as it will create problems with feature like 'getNonConsoleLogger()'. Please add an id to your reporter.");
|
|
6514
6512
|
}
|
|
6515
|
-
if (!
|
|
6516
|
-
|
|
6513
|
+
if (!standard_log_ctx_js_1.ctx.gsl)
|
|
6514
|
+
standard_log_ctx_js_1.ctx.gsl = closure;
|
|
6517
6515
|
return closure.standardLog;
|
|
6518
6516
|
}
|
|
6519
6517
|
exports.createStandardLog = createStandardLog;
|
|
@@ -6521,9 +6519,9 @@ function noop() { }
|
|
|
6521
6519
|
function createStandardLogClosure(options) {
|
|
6522
6520
|
var _a, _b, _c;
|
|
6523
6521
|
// TODO reporter.id must not be empty
|
|
6524
|
-
var store = (0,
|
|
6522
|
+
var store = (0, log_store_js_1.createLogStore)((0, type_plus_1.required)({ logLevel: log_levels_js_1.logLevels.info }, options));
|
|
6525
6523
|
var nonConsoleReporters = (_b = (_a = options === null || options === void 0 ? void 0 : options.reporters) === null || _a === void 0 ? void 0 : _a.filter(function (r) { return !r.isConsoleReporter; }).map(function (r) { return r.id; })) !== null && _b !== void 0 ? _b : [];
|
|
6526
|
-
var logMethods =
|
|
6524
|
+
var logMethods = log_levels_js_1.DEFAULT_LOG_METHOD_NAMES.concat(Object.keys((_c = options === null || options === void 0 ? void 0 : options.customLevels) !== null && _c !== void 0 ? _c : {})).concat([
|
|
6527
6525
|
'on',
|
|
6528
6526
|
'count',
|
|
6529
6527
|
'write'
|
|
@@ -6570,20 +6568,13 @@ function createDummyLogger(logMethods) {
|
|
|
6570
6568
|
return p;
|
|
6571
6569
|
}, (0, type_plus_1.record)());
|
|
6572
6570
|
}
|
|
6573
|
-
function createStandardLogForTest(logLevel) {
|
|
6574
|
-
if (logLevel === void 0) { logLevel = logLevels_js_1.logLevels.debug; }
|
|
6575
|
-
var reporter = (0, memory_js_1.createMemoryLogReporter)();
|
|
6576
|
-
var closure = createStandardLogClosure({ reporters: [reporter], logLevel: logLevel });
|
|
6577
|
-
return __assign(__assign({}, closure.standardLog), { reporter: reporter });
|
|
6578
|
-
}
|
|
6579
|
-
exports.createStandardLogForTest = createStandardLogForTest;
|
|
6580
6571
|
function suppressLogs(block) {
|
|
6581
6572
|
var logs = [];
|
|
6582
6573
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
6583
6574
|
logs[_i - 1] = arguments[_i];
|
|
6584
6575
|
}
|
|
6585
6576
|
var origLevels = logs.map(function (l) { return l.level; });
|
|
6586
|
-
logs.forEach(function (l) { return (l.level =
|
|
6577
|
+
logs.forEach(function (l) { return (l.level = log_levels_js_1.logLevels.none); });
|
|
6587
6578
|
var result = block();
|
|
6588
6579
|
logs.forEach(function (l, i) { return (l.level = origLevels[i]); });
|
|
6589
6580
|
return result;
|
|
@@ -6594,29 +6585,29 @@ function getLogger(id, options) {
|
|
|
6594
6585
|
}
|
|
6595
6586
|
exports.getLogger = getLogger;
|
|
6596
6587
|
function getGlobalSL() {
|
|
6597
|
-
if (!
|
|
6598
|
-
|
|
6599
|
-
return
|
|
6588
|
+
if (!standard_log_ctx_js_1.ctx.gsl)
|
|
6589
|
+
standard_log_ctx_js_1.ctx.gsl = createStandardLogClosure();
|
|
6590
|
+
return standard_log_ctx_js_1.ctx.gsl.standardLog;
|
|
6600
6591
|
}
|
|
6601
6592
|
function configGlobal(options) {
|
|
6602
|
-
if (
|
|
6603
|
-
var log =
|
|
6593
|
+
if (standard_log_ctx_js_1.ctx.configured) {
|
|
6594
|
+
var log = standard_log_ctx_js_1.ctx.gsl.standardLog.getLogger('standard-log');
|
|
6604
6595
|
log.warn('configGlobal() is being called more than once. Please make sure this is expected. Application should use `createStandardLog()` most of the time.');
|
|
6605
6596
|
}
|
|
6606
|
-
if (
|
|
6597
|
+
if (standard_log_ctx_js_1.ctx.gsl) {
|
|
6607
6598
|
if (options.logLevel) {
|
|
6608
|
-
|
|
6599
|
+
standard_log_ctx_js_1.ctx.gsl.store.logLevel = options.logLevel;
|
|
6609
6600
|
}
|
|
6610
6601
|
if (options.reporters) {
|
|
6611
|
-
var reporters =
|
|
6602
|
+
var reporters = standard_log_ctx_js_1.ctx.gsl.store.reporters;
|
|
6612
6603
|
reporters.length = 0;
|
|
6613
6604
|
reporters.push.apply(reporters, options.reporters);
|
|
6614
6605
|
}
|
|
6615
6606
|
}
|
|
6616
6607
|
else {
|
|
6617
|
-
|
|
6608
|
+
standard_log_ctx_js_1.ctx.gsl = createStandardLogClosure(options);
|
|
6618
6609
|
}
|
|
6619
|
-
|
|
6610
|
+
standard_log_ctx_js_1.ctx.configured = true;
|
|
6620
6611
|
}
|
|
6621
6612
|
exports.configGlobal = configGlobal;
|
|
6622
6613
|
|
|
Binary file
|