@anjianshi/utils 2.1.0 → 2.1.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/logging/adapt.js +3 -0
- package/package.json +1 -1
package/logging/adapt.js
CHANGED
|
@@ -34,6 +34,9 @@ export function adaptDebugLib(debugLib, enable = '', logger) {
|
|
|
34
34
|
logger = getLogger('3rd-library');
|
|
35
35
|
debugLib.log = logger.debug.bind(logger);
|
|
36
36
|
if (enable) {
|
|
37
|
+
// 有些库(例如 prisma)重新实现了自己的 debug 库,且模仿 debug 也读取 DEBUG 环境变量。
|
|
38
|
+
// 这里除了设置 debug 库,顺便也适配这些遵循 debug 库模式的自定义库。
|
|
39
|
+
process.env.DEBUG = enable;
|
|
37
40
|
debugLib.enable(enable);
|
|
38
41
|
}
|
|
39
42
|
}
|