@sprucelabs/spruce-skill-utils 31.2.17 → 31.2.18
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.
|
@@ -59,7 +59,7 @@ export default function buildLog(prefix = undefined, options) {
|
|
|
59
59
|
}
|
|
60
60
|
function write(chalkMethod, rawArgs, level) {
|
|
61
61
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
62
|
-
if (!shouldWrite((_c = (_b = (_a = getProcess()) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.LOG_LEVEL) !== null && _c !== void 0 ? _c :
|
|
62
|
+
if (!shouldWrite((_c = (_b = (_a = getProcess()) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.LOG_LEVEL) !== null && _c !== void 0 ? _c : undefined, level)) {
|
|
63
63
|
return '';
|
|
64
64
|
}
|
|
65
65
|
const args = rawArgs.map((a) => { var _a, _b; return (_b = (_a = a === null || a === void 0 ? void 0 : a.toString) === null || _a === void 0 ? void 0 : _a.call(a)) !== null && _b !== void 0 ? _b : 'undefined'; });
|
|
@@ -134,7 +134,7 @@ export const stubLog = buildLog('STUB', {
|
|
|
134
134
|
useColors: false,
|
|
135
135
|
});
|
|
136
136
|
function shouldWrite(maxLogLevel, level) {
|
|
137
|
-
if (
|
|
137
|
+
if (maxLogLevel) {
|
|
138
138
|
if (process.env.LOG_LEVEL == 'none') {
|
|
139
139
|
return false;
|
|
140
140
|
}
|
|
@@ -64,7 +64,7 @@ function buildLog(prefix = undefined, options) {
|
|
|
64
64
|
return t;
|
|
65
65
|
}
|
|
66
66
|
function write(chalkMethod, rawArgs, level) {
|
|
67
|
-
if (!shouldWrite(getProcess()?.env?.LOG_LEVEL ??
|
|
67
|
+
if (!shouldWrite(getProcess()?.env?.LOG_LEVEL ?? undefined, level)) {
|
|
68
68
|
return '';
|
|
69
69
|
}
|
|
70
70
|
const args = rawArgs.map((a) => a?.toString?.() ?? 'undefined');
|
|
@@ -138,7 +138,7 @@ exports.stubLog = buildLog('STUB', {
|
|
|
138
138
|
useColors: false,
|
|
139
139
|
});
|
|
140
140
|
function shouldWrite(maxLogLevel, level) {
|
|
141
|
-
if (
|
|
141
|
+
if (maxLogLevel) {
|
|
142
142
|
if (process.env.LOG_LEVEL == 'none') {
|
|
143
143
|
return false;
|
|
144
144
|
}
|