@typespec/ts-http-runtime 1.0.0-alpha.20240108.2 → 1.0.0-alpha.20240110.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/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -393,6 +393,7 @@ function extend(namespace) {
|
|
|
393
393
|
newDebugger.log = this.log;
|
|
394
394
|
return newDebugger;
|
|
395
395
|
}
|
|
396
|
+
var debug = debugObj;
|
|
396
397
|
|
|
397
398
|
// Copyright (c) Microsoft Corporation.
|
|
398
399
|
// Licensed under the MIT license.
|
|
@@ -405,9 +406,9 @@ let typeSpecRuntimeLogLevel;
|
|
|
405
406
|
* By default, logs are sent to stderr.
|
|
406
407
|
* Override the `log` method to redirect logs to another location.
|
|
407
408
|
*/
|
|
408
|
-
const TypeSpecRuntimeLogger =
|
|
409
|
+
const TypeSpecRuntimeLogger = debug("typeSpecRuntime");
|
|
409
410
|
TypeSpecRuntimeLogger.log = (...args) => {
|
|
410
|
-
|
|
411
|
+
debug.log(...args);
|
|
411
412
|
};
|
|
412
413
|
const TYPESPEC_RUNTIME_LOG_LEVELS = ["verbose", "info", "warning", "error"];
|
|
413
414
|
if (logLevelFromEnv) {
|
|
@@ -439,7 +440,7 @@ function setLogLevel(level) {
|
|
|
439
440
|
enabledNamespaces.push(logger.namespace);
|
|
440
441
|
}
|
|
441
442
|
}
|
|
442
|
-
|
|
443
|
+
debug.enable(enabledNamespaces.join(","));
|
|
443
444
|
}
|
|
444
445
|
const levelMap = {
|
|
445
446
|
verbose: 400,
|
|
@@ -473,8 +474,8 @@ function createLogger(parent, level) {
|
|
|
473
474
|
});
|
|
474
475
|
patchLogMethod(parent, logger);
|
|
475
476
|
if (shouldEnable(logger)) {
|
|
476
|
-
const enabledNamespaces =
|
|
477
|
-
|
|
477
|
+
const enabledNamespaces = debug.disable();
|
|
478
|
+
debug.enable(enabledNamespaces + "," + logger.namespace);
|
|
478
479
|
}
|
|
479
480
|
registeredLoggers.add(logger);
|
|
480
481
|
return logger;
|