@storm-software/config-tools 1.148.3 → 1.149.0
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 +1 -1
- package/dist/config-file/get-config-file.cjs +66 -22
- package/dist/config-file/get-config-file.js +65 -21
- package/dist/config-file/index.cjs +1 -27
- package/dist/config-file/index.js +1 -27
- package/dist/create-storm-config.cjs +68 -26
- package/dist/create-storm-config.js +67 -25
- package/dist/env/get-env.cjs +152 -9
- package/dist/env/get-env.js +151 -8
- package/dist/env/index.cjs +2 -20
- package/dist/env/index.js +2 -20
- package/dist/env/set-env.cjs +259 -8
- package/dist/env/set-env.js +258 -7
- package/dist/get-config.cjs +9 -25
- package/dist/get-config.js +9 -25
- package/dist/index.cjs +7 -171
- package/dist/index.js +7 -171
- package/dist/logger/chalk.cjs +30 -4
- package/dist/logger/chalk.js +29 -3
- package/dist/logger/console-icons.cjs +15 -5
- package/dist/logger/console-icons.js +15 -5
- package/dist/logger/console.cjs +126 -38
- package/dist/logger/console.js +112 -24
- package/dist/logger/create-logger.cjs +31 -16
- package/dist/logger/create-logger.js +30 -15
- package/dist/logger/format-timestamp.cjs +5 -3
- package/dist/logger/format-timestamp.js +5 -3
- package/dist/logger/get-log-level.cjs +56 -6
- package/dist/logger/get-log-level.js +56 -6
- package/dist/logger/index.cjs +7 -62
- package/dist/logger/index.js +7 -62
- package/dist/logger/is-unicode-supported.cjs +16 -4
- package/dist/logger/is-unicode-supported.js +15 -3
- package/dist/types.cjs +24 -6
- package/dist/types.js +22 -4
- package/dist/utilities/apply-workspace-tokens.cjs +55 -9
- package/dist/utilities/apply-workspace-tokens.js +54 -8
- package/dist/utilities/correct-paths.cjs +242 -33
- package/dist/utilities/correct-paths.js +225 -16
- package/dist/utilities/file-path-utils.cjs +18 -5
- package/dist/utilities/file-path-utils.js +17 -4
- package/dist/utilities/find-up.cjs +22 -4
- package/dist/utilities/find-up.js +21 -3
- package/dist/utilities/find-workspace-root.cjs +64 -7
- package/dist/utilities/find-workspace-root.js +63 -6
- package/dist/utilities/get-default-config.cjs +79 -8
- package/dist/utilities/get-default-config.js +79 -8
- package/dist/utilities/index.cjs +7 -85
- package/dist/utilities/index.js +7 -85
- package/dist/utilities/process-handler.cjs +35 -17
- package/dist/utilities/process-handler.js +35 -17
- package/dist/utilities/run.cjs +34 -6
- package/dist/utilities/run.js +33 -5
- package/package.json +1 -1
- package/dist/chunk-23WUCNWX.js +0 -142
- package/dist/chunk-2AVLCXLT.js +0 -0
- package/dist/chunk-2IKEUEGY.cjs +0 -94
- package/dist/chunk-3NWKPYIG.cjs +0 -68
- package/dist/chunk-4DLP6LZY.cjs +0 -65
- package/dist/chunk-65SWKEHV.cjs +0 -1
- package/dist/chunk-6OM23J4N.js +0 -65
- package/dist/chunk-6T3V5XJK.js +0 -180
- package/dist/chunk-7JBLPO7O.cjs +0 -168
- package/dist/chunk-7NSHGJWY.cjs +0 -12
- package/dist/chunk-7PV6L7I7.cjs +0 -1
- package/dist/chunk-BHZFTVXN.js +0 -42
- package/dist/chunk-C4RHWKK6.cjs +0 -142
- package/dist/chunk-CCO2PASC.js +0 -168
- package/dist/chunk-DD3HX2NX.cjs +0 -1
- package/dist/chunk-DD5UX56L.cjs +0 -272
- package/dist/chunk-FDJZUZKJ.js +0 -93
- package/dist/chunk-GS25DBTT.cjs +0 -93
- package/dist/chunk-GZFXEQPB.js +0 -94
- package/dist/chunk-HESFC24Z.cjs +0 -245
- package/dist/chunk-HI33NNPB.js +0 -68
- package/dist/chunk-HKZSDZZ4.cjs +0 -19
- package/dist/chunk-HSCCBYAV.js +0 -25
- package/dist/chunk-IRCFHYKZ.cjs +0 -28
- package/dist/chunk-IUT7Y2UY.js +0 -26
- package/dist/chunk-IWD6YQKX.cjs +0 -1
- package/dist/chunk-KNLWLA7O.cjs +0 -75
- package/dist/chunk-L6UNTUC4.js +0 -0
- package/dist/chunk-MLUBD3PU.js +0 -245
- package/dist/chunk-NJVL3GF4.js +0 -0
- package/dist/chunk-OIEEXHKO.js +0 -75
- package/dist/chunk-P7Q327IR.js +0 -272
- package/dist/chunk-POXTJ6GF.js +0 -28
- package/dist/chunk-PR7RQHRE.js +0 -12
- package/dist/chunk-Q7MMWMEN.js +0 -44
- package/dist/chunk-QBS3OCHH.js +0 -22
- package/dist/chunk-RRKB32OH.js +0 -0
- package/dist/chunk-RVM5N5ZI.cjs +0 -22
- package/dist/chunk-SLGVSUEV.cjs +0 -36
- package/dist/chunk-SVQE7WVB.cjs +0 -180
- package/dist/chunk-SWX2MJHI.cjs +0 -28
- package/dist/chunk-TZO4SYUO.cjs +0 -49
- package/dist/chunk-UZ5SHCFX.js +0 -49
- package/dist/chunk-WMWOH7LS.js +0 -79
- package/dist/chunk-XAJB3BSF.cjs +0 -25
- package/dist/chunk-XDBACKKN.cjs +0 -42
- package/dist/chunk-XIVRONKM.cjs +0 -44
- package/dist/chunk-XQPQRRG3.js +0 -28
- package/dist/chunk-XVIPFWZW.cjs +0 -79
- package/dist/chunk-XY2LDOQ4.cjs +0 -26
- package/dist/chunk-ZA4IO7YJ.js +0 -36
- package/dist/chunk-ZU6V7IRV.js +0 -19
package/dist/logger/chalk.cjs
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
|
|
4
|
+
var _chalk2 = require('chalk'); var _chalk3 = _interopRequireDefault(_chalk2);
|
|
5
|
+
const chalkDefault = {
|
|
6
|
+
hex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => (message) => message, "hex"),
|
|
7
|
+
bgHex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => ({
|
|
8
|
+
whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright")
|
|
9
|
+
}), "bgHex"),
|
|
10
|
+
whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright"),
|
|
11
|
+
gray: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "gray"),
|
|
12
|
+
bold: {
|
|
13
|
+
hex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => (message) => message, "hex"),
|
|
14
|
+
bgHex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => ({
|
|
15
|
+
whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright")
|
|
16
|
+
}), "bgHex"),
|
|
17
|
+
whiteBright: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "whiteBright")
|
|
18
|
+
},
|
|
19
|
+
dim: {
|
|
20
|
+
hex: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (_) => (message) => message, "hex"),
|
|
21
|
+
gray: /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message) => message, "gray")
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const getChalk = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
25
|
+
let _chalk = _chalk3.default;
|
|
26
|
+
if (!_optionalChain([_chalk, 'optionalAccess', _2 => _2.hex]) || !_optionalChain([_chalk, 'optionalAccess', _3 => _3.bold, 'optionalAccess', _4 => _4.hex]) || !_optionalChain([_chalk, 'optionalAccess', _5 => _5.bgHex]) || !_optionalChain([_chalk, 'optionalAccess', _6 => _6.whiteBright])) {
|
|
27
|
+
_chalk = chalkDefault;
|
|
28
|
+
}
|
|
29
|
+
return _chalk;
|
|
30
|
+
}, "getChalk");
|
|
5
31
|
|
|
6
32
|
|
|
7
|
-
exports.getChalk =
|
|
33
|
+
exports.getChalk = getChalk;
|
package/dist/logger/chalk.js
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "
|
|
2
|
+
__name
|
|
3
|
+
} from "../chunk-SHUYVCID.js";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
const chalkDefault = {
|
|
6
|
+
hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
|
|
7
|
+
bgHex: /* @__PURE__ */ __name((_) => ({
|
|
8
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
|
|
9
|
+
}), "bgHex"),
|
|
10
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright"),
|
|
11
|
+
gray: /* @__PURE__ */ __name((message) => message, "gray"),
|
|
12
|
+
bold: {
|
|
13
|
+
hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
|
|
14
|
+
bgHex: /* @__PURE__ */ __name((_) => ({
|
|
15
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
|
|
16
|
+
}), "bgHex"),
|
|
17
|
+
whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
|
|
18
|
+
},
|
|
19
|
+
dim: {
|
|
20
|
+
hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
|
|
21
|
+
gray: /* @__PURE__ */ __name((message) => message, "gray")
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const getChalk = /* @__PURE__ */ __name(() => {
|
|
25
|
+
let _chalk = chalk;
|
|
26
|
+
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
|
|
27
|
+
_chalk = chalkDefault;
|
|
28
|
+
}
|
|
29
|
+
return _chalk;
|
|
30
|
+
}, "getChalk");
|
|
5
31
|
export {
|
|
6
32
|
getChalk
|
|
7
33
|
};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../
|
|
5
|
-
require('
|
|
6
|
-
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
|
|
4
|
+
var _types = require('../types');
|
|
5
|
+
var _isunicodesupported = require('./is-unicode-supported');
|
|
6
|
+
const useIcon = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (c, fallback) => _isunicodesupported.isUnicodeSupported.call(void 0, ) ? c : fallback, "useIcon");
|
|
7
|
+
const CONSOLE_ICONS = {
|
|
8
|
+
[_types.LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
9
|
+
[_types.LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
10
|
+
[_types.LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
11
|
+
[_types.LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
12
|
+
[_types.LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
13
|
+
[_types.LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
14
|
+
[_types.LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
15
|
+
[_types.LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
16
|
+
};
|
|
7
17
|
|
|
8
18
|
|
|
9
|
-
exports.CONSOLE_ICONS =
|
|
19
|
+
exports.CONSOLE_ICONS = CONSOLE_ICONS;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../
|
|
5
|
-
import "
|
|
6
|
-
|
|
2
|
+
__name
|
|
3
|
+
} from "../chunk-SHUYVCID.js";
|
|
4
|
+
import { LogLevelLabel } from "../types";
|
|
5
|
+
import { isUnicodeSupported } from "./is-unicode-supported";
|
|
6
|
+
const useIcon = /* @__PURE__ */ __name((c, fallback) => isUnicodeSupported() ? c : fallback, "useIcon");
|
|
7
|
+
const CONSOLE_ICONS = {
|
|
8
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
9
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
10
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
11
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
12
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
13
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
14
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
15
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
16
|
+
};
|
|
7
17
|
export {
|
|
8
18
|
CONSOLE_ICONS
|
|
9
19
|
};
|
package/dist/logger/console.cjs
CHANGED
|
@@ -1,38 +1,126 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
|
|
4
|
+
var _types = require('../types');
|
|
5
|
+
var _getdefaultconfig = require('../utilities/get-default-config');
|
|
6
|
+
var _chalk2 = require('./chalk');
|
|
7
|
+
var _consoleicons = require('./console-icons');
|
|
8
|
+
var _formattimestamp = require('./format-timestamp');
|
|
9
|
+
var _getloglevel = require('./get-log-level');
|
|
10
|
+
const getLogFn = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel = _types.LogLevel.INFO, config = {}, _chalk = _chalk2.getChalk.call(void 0, )) => {
|
|
11
|
+
const colors = !_optionalChain([config, 'access', _2 => _2.colors, 'optionalAccess', _3 => _3.dark]) && !_optionalChain([config, 'access', _4 => _4.colors, 'optionalAccess', _5 => _5["base"]]) && !_optionalChain([config, 'access', _6 => _6.colors, 'optionalAccess', _7 => _7["base"], 'optionalAccess', _8 => _8.dark]) ? _getdefaultconfig.DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _9 => _9.colors, 'optionalAccess', _10 => _10.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12["base"], 'optionalAccess', _13 => _13.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _14 => _14.colors, 'optionalAccess', _15 => _15["base"]]) ? _optionalChain([config, 'access', _16 => _16.colors, 'optionalAccess', _17 => _17["base"]]) : _getdefaultconfig.DEFAULT_COLOR_CONFIG;
|
|
12
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || _types.LogLevelLabel.INFO;
|
|
13
|
+
if (logLevel > _getloglevel.getLogLevel.call(void 0, configLogLevel) || logLevel <= _types.LogLevel.SILENT || _getloglevel.getLogLevel.call(void 0, configLogLevel) <= _types.LogLevel.SILENT) {
|
|
14
|
+
return (_) => {
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (typeof logLevel === "number" && _types.LogLevel.FATAL >= logLevel) {
|
|
18
|
+
return (message) => {
|
|
19
|
+
console.error(`
|
|
20
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
21
|
+
`);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (typeof logLevel === "number" && _types.LogLevel.ERROR >= logLevel) {
|
|
25
|
+
return (message) => {
|
|
26
|
+
console.error(`
|
|
27
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
28
|
+
`);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (typeof logLevel === "number" && _types.LogLevel.WARN >= logLevel) {
|
|
32
|
+
return (message) => {
|
|
33
|
+
console.warn(`
|
|
34
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
35
|
+
`);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (typeof logLevel === "number" && _types.LogLevel.SUCCESS >= logLevel) {
|
|
39
|
+
return (message) => {
|
|
40
|
+
console.info(`
|
|
41
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
42
|
+
`);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (typeof logLevel === "number" && _types.LogLevel.INFO >= logLevel) {
|
|
46
|
+
return (message) => {
|
|
47
|
+
console.info(`
|
|
48
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
49
|
+
`);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (typeof logLevel === "number" && _types.LogLevel.DEBUG >= logLevel) {
|
|
53
|
+
return (message) => {
|
|
54
|
+
console.debug(`
|
|
55
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
56
|
+
`);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (typeof logLevel === "number" && _types.LogLevel.TRACE >= logLevel) {
|
|
60
|
+
return (message) => {
|
|
61
|
+
console.debug(`
|
|
62
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
63
|
+
`);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return (message) => {
|
|
67
|
+
console.log(`
|
|
68
|
+
${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
69
|
+
`);
|
|
70
|
+
};
|
|
71
|
+
}, "getLogFn");
|
|
72
|
+
const writeFatal = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.FATAL, config)(message), "writeFatal");
|
|
73
|
+
const writeError = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.ERROR, config)(message), "writeError");
|
|
74
|
+
const writeWarning = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.WARN, config)(message), "writeWarning");
|
|
75
|
+
const writeInfo = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.INFO, config)(message), "writeInfo");
|
|
76
|
+
const writeSuccess = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
77
|
+
const writeDebug = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.DEBUG, config)(message), "writeDebug");
|
|
78
|
+
const writeTrace = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.TRACE, config)(message), "writeTrace");
|
|
79
|
+
const writeSystem = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.ALL, config)(message), "writeSystem");
|
|
80
|
+
const getStopwatch = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (name) => {
|
|
81
|
+
const start = process.hrtime();
|
|
82
|
+
return () => {
|
|
83
|
+
const end = process.hrtime(start);
|
|
84
|
+
console.info(`
|
|
85
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
|
|
86
|
+
|
|
87
|
+
`);
|
|
88
|
+
};
|
|
89
|
+
}, "getStopwatch");
|
|
90
|
+
const MAX_DEPTH = 4;
|
|
91
|
+
const formatLogMessage = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, options = {}, depth = 0) => {
|
|
92
|
+
if (depth > MAX_DEPTH) {
|
|
93
|
+
return "<max depth>";
|
|
94
|
+
}
|
|
95
|
+
const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
|
|
96
|
+
const skip = _nullishCoalesce(options.skip, () => ( []));
|
|
97
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
98
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
99
|
+
prefix: `${prefix}-`,
|
|
100
|
+
skip
|
|
101
|
+
}, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
102
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
|
|
103
|
+
prefix: `${prefix}-`,
|
|
104
|
+
skip
|
|
105
|
+
}, depth + 1) : message[key]}`).join("\n")}` : message;
|
|
106
|
+
}, "formatLogMessage");
|
|
107
|
+
const _isFunction = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (value) => {
|
|
108
|
+
try {
|
|
109
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _18 => _18.constructor]) && _optionalChain([value, 'optionalAccess', _19 => _19.call]) && _optionalChain([value, 'optionalAccess', _20 => _20.apply]));
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}, "_isFunction");
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
exports.formatLogMessage = formatLogMessage; exports.getLogFn = getLogFn; exports.getStopwatch = getStopwatch; exports.writeDebug = writeDebug; exports.writeError = writeError; exports.writeFatal = writeFatal; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeSystem = writeSystem; exports.writeTrace = writeTrace; exports.writeWarning = writeWarning;
|
package/dist/logger/console.js
CHANGED
|
@@ -1,28 +1,116 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
__name
|
|
3
|
+
} from "../chunk-SHUYVCID.js";
|
|
4
|
+
import { LogLevel, LogLevelLabel } from "../types";
|
|
5
|
+
import { DEFAULT_COLOR_CONFIG } from "../utilities/get-default-config";
|
|
6
|
+
import { getChalk } from "./chalk";
|
|
7
|
+
import { CONSOLE_ICONS } from "./console-icons";
|
|
8
|
+
import { formatTimestamp } from "./format-timestamp";
|
|
9
|
+
import { getLogLevel } from "./get-log-level";
|
|
10
|
+
const getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
11
|
+
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
12
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
13
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
14
|
+
return (_) => {
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
18
|
+
return (message) => {
|
|
19
|
+
console.error(`
|
|
20
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
21
|
+
`);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
25
|
+
return (message) => {
|
|
26
|
+
console.error(`
|
|
27
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
28
|
+
`);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
32
|
+
return (message) => {
|
|
33
|
+
console.warn(`
|
|
34
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
35
|
+
`);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
39
|
+
return (message) => {
|
|
40
|
+
console.info(`
|
|
41
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
42
|
+
`);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
46
|
+
return (message) => {
|
|
47
|
+
console.info(`
|
|
48
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
49
|
+
`);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
53
|
+
return (message) => {
|
|
54
|
+
console.debug(`
|
|
55
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
56
|
+
`);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
60
|
+
return (message) => {
|
|
61
|
+
console.debug(`
|
|
62
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
63
|
+
`);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return (message) => {
|
|
67
|
+
console.log(`
|
|
68
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
69
|
+
`);
|
|
70
|
+
};
|
|
71
|
+
}, "getLogFn");
|
|
72
|
+
const writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
|
|
73
|
+
const writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
|
|
74
|
+
const writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
|
|
75
|
+
const writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
|
|
76
|
+
const writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
77
|
+
const writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
78
|
+
const writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
79
|
+
const writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
80
|
+
const getStopwatch = /* @__PURE__ */ __name((name) => {
|
|
81
|
+
const start = process.hrtime();
|
|
82
|
+
return () => {
|
|
83
|
+
const end = process.hrtime(start);
|
|
84
|
+
console.info(`
|
|
85
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
|
|
86
|
+
|
|
87
|
+
`);
|
|
88
|
+
};
|
|
89
|
+
}, "getStopwatch");
|
|
90
|
+
const MAX_DEPTH = 4;
|
|
91
|
+
const formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth = 0) => {
|
|
92
|
+
if (depth > MAX_DEPTH) {
|
|
93
|
+
return "<max depth>";
|
|
94
|
+
}
|
|
95
|
+
const prefix = options.prefix ?? "-";
|
|
96
|
+
const skip = options.skip ?? [];
|
|
97
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
98
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
99
|
+
prefix: `${prefix}-`,
|
|
100
|
+
skip
|
|
101
|
+
}, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
102
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
|
|
103
|
+
prefix: `${prefix}-`,
|
|
104
|
+
skip
|
|
105
|
+
}, depth + 1) : message[key]}`).join("\n")}` : message;
|
|
106
|
+
}, "formatLogMessage");
|
|
107
|
+
const _isFunction = /* @__PURE__ */ __name((value) => {
|
|
108
|
+
try {
|
|
109
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}, "_isFunction");
|
|
26
114
|
export {
|
|
27
115
|
formatLogMessage,
|
|
28
116
|
getLogFn,
|
|
@@ -1,19 +1,34 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('
|
|
5
|
-
require('../
|
|
6
|
-
require('../
|
|
7
|
-
require('
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
|
|
4
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
5
|
+
var _types = require('../types');
|
|
6
|
+
var _findworkspaceroot = require('../utilities/find-workspace-root');
|
|
7
|
+
var _console = require('./console');
|
|
8
|
+
async function createLogger(config) {
|
|
9
|
+
const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, );
|
|
10
|
+
if (!workspaceRoot) {
|
|
11
|
+
throw new Error("Cannot find workspace root");
|
|
12
|
+
}
|
|
13
|
+
const writeFatal = _console.getLogFn.call(void 0, _types.LogLevel.FATAL, config, _chalk2.default);
|
|
14
|
+
const writeError = _console.getLogFn.call(void 0, _types.LogLevel.ERROR, config, _chalk2.default);
|
|
15
|
+
const writeWarning = _console.getLogFn.call(void 0, _types.LogLevel.WARN, config, _chalk2.default);
|
|
16
|
+
const writeInfo = _console.getLogFn.call(void 0, _types.LogLevel.INFO, config, _chalk2.default);
|
|
17
|
+
const writeSuccess = _console.getLogFn.call(void 0, _types.LogLevel.SUCCESS, config, _chalk2.default);
|
|
18
|
+
const writeDebug = _console.getLogFn.call(void 0, _types.LogLevel.DEBUG, config, _chalk2.default);
|
|
19
|
+
const writeTrace = _console.getLogFn.call(void 0, _types.LogLevel.DEBUG, config, _chalk2.default);
|
|
20
|
+
return {
|
|
21
|
+
fatal: writeFatal,
|
|
22
|
+
error: writeError,
|
|
23
|
+
warning: writeWarning,
|
|
24
|
+
info: writeInfo,
|
|
25
|
+
success: writeSuccess,
|
|
26
|
+
debug: writeDebug,
|
|
27
|
+
trace: writeTrace,
|
|
28
|
+
getStopwatch: _console.getStopwatch
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
_chunkUSNT2KNTcjs.__name.call(void 0, createLogger, "createLogger");
|
|
17
32
|
|
|
18
33
|
|
|
19
|
-
exports.createLogger =
|
|
34
|
+
exports.createLogger = createLogger;
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "
|
|
5
|
-
import "../
|
|
6
|
-
import "../
|
|
7
|
-
import "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
__name
|
|
3
|
+
} from "../chunk-SHUYVCID.js";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import { LogLevel } from "../types";
|
|
6
|
+
import { findWorkspaceRoot } from "../utilities/find-workspace-root";
|
|
7
|
+
import { getLogFn, getStopwatch } from "./console";
|
|
8
|
+
async function createLogger(config) {
|
|
9
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
10
|
+
if (!workspaceRoot) {
|
|
11
|
+
throw new Error("Cannot find workspace root");
|
|
12
|
+
}
|
|
13
|
+
const writeFatal = getLogFn(LogLevel.FATAL, config, chalk);
|
|
14
|
+
const writeError = getLogFn(LogLevel.ERROR, config, chalk);
|
|
15
|
+
const writeWarning = getLogFn(LogLevel.WARN, config, chalk);
|
|
16
|
+
const writeInfo = getLogFn(LogLevel.INFO, config, chalk);
|
|
17
|
+
const writeSuccess = getLogFn(LogLevel.SUCCESS, config, chalk);
|
|
18
|
+
const writeDebug = getLogFn(LogLevel.DEBUG, config, chalk);
|
|
19
|
+
const writeTrace = getLogFn(LogLevel.DEBUG, config, chalk);
|
|
20
|
+
return {
|
|
21
|
+
fatal: writeFatal,
|
|
22
|
+
error: writeError,
|
|
23
|
+
warning: writeWarning,
|
|
24
|
+
info: writeInfo,
|
|
25
|
+
success: writeSuccess,
|
|
26
|
+
debug: writeDebug,
|
|
27
|
+
trace: writeTrace,
|
|
28
|
+
getStopwatch
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
__name(createLogger, "createLogger");
|
|
17
32
|
export {
|
|
18
33
|
createLogger
|
|
19
34
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
|
|
4
|
+
const formatTimestamp = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (date = /* @__PURE__ */ new Date()) => {
|
|
5
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
6
|
+
}, "formatTimestamp");
|
|
5
7
|
|
|
6
8
|
|
|
7
|
-
exports.formatTimestamp =
|
|
9
|
+
exports.formatTimestamp = formatTimestamp;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
|
|
2
|
+
__name
|
|
3
|
+
} from "../chunk-SHUYVCID.js";
|
|
4
|
+
const formatTimestamp = /* @__PURE__ */ __name((date = /* @__PURE__ */ new Date()) => {
|
|
5
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
6
|
+
}, "formatTimestamp");
|
|
5
7
|
export {
|
|
6
8
|
formatTimestamp
|
|
7
9
|
};
|
|
@@ -1,12 +1,62 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
|
|
4
|
+
var _types = require('../types');
|
|
5
|
+
const getLogLevel = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (label) => {
|
|
6
|
+
switch (label) {
|
|
7
|
+
case "all":
|
|
8
|
+
return _types.LogLevel.ALL;
|
|
9
|
+
case "trace":
|
|
10
|
+
return _types.LogLevel.TRACE;
|
|
11
|
+
case "debug":
|
|
12
|
+
return _types.LogLevel.DEBUG;
|
|
13
|
+
case "info":
|
|
14
|
+
return _types.LogLevel.INFO;
|
|
15
|
+
case "warn":
|
|
16
|
+
return _types.LogLevel.WARN;
|
|
17
|
+
case "error":
|
|
18
|
+
return _types.LogLevel.ERROR;
|
|
19
|
+
case "fatal":
|
|
20
|
+
return _types.LogLevel.FATAL;
|
|
21
|
+
case "silent":
|
|
22
|
+
return _types.LogLevel.SILENT;
|
|
23
|
+
default:
|
|
24
|
+
return _types.LogLevel.INFO;
|
|
25
|
+
}
|
|
26
|
+
}, "getLogLevel");
|
|
27
|
+
const getLogLevelLabel = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel = _types.LogLevel.INFO) => {
|
|
28
|
+
if (logLevel >= _types.LogLevel.ALL) {
|
|
29
|
+
return _types.LogLevelLabel.ALL;
|
|
30
|
+
}
|
|
31
|
+
if (logLevel >= _types.LogLevel.TRACE) {
|
|
32
|
+
return _types.LogLevelLabel.TRACE;
|
|
33
|
+
}
|
|
34
|
+
if (logLevel >= _types.LogLevel.DEBUG) {
|
|
35
|
+
return _types.LogLevelLabel.DEBUG;
|
|
36
|
+
}
|
|
37
|
+
if (logLevel >= _types.LogLevel.INFO) {
|
|
38
|
+
return _types.LogLevelLabel.INFO;
|
|
39
|
+
}
|
|
40
|
+
if (logLevel >= _types.LogLevel.WARN) {
|
|
41
|
+
return _types.LogLevelLabel.WARN;
|
|
42
|
+
}
|
|
43
|
+
if (logLevel >= _types.LogLevel.ERROR) {
|
|
44
|
+
return _types.LogLevelLabel.ERROR;
|
|
45
|
+
}
|
|
46
|
+
if (logLevel >= _types.LogLevel.FATAL) {
|
|
47
|
+
return _types.LogLevelLabel.FATAL;
|
|
48
|
+
}
|
|
49
|
+
if (logLevel <= _types.LogLevel.SILENT) {
|
|
50
|
+
return _types.LogLevelLabel.SILENT;
|
|
51
|
+
}
|
|
52
|
+
return _types.LogLevelLabel.INFO;
|
|
53
|
+
}, "getLogLevelLabel");
|
|
54
|
+
const isVerbose = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (label = _types.LogLevelLabel.SILENT) => {
|
|
55
|
+
const logLevel = typeof label === "string" ? getLogLevel(label) : label;
|
|
56
|
+
return logLevel >= _types.LogLevel.DEBUG;
|
|
57
|
+
}, "isVerbose");
|
|
3
58
|
|
|
4
59
|
|
|
5
|
-
var _chunk3NWKPYIGcjs = require('../chunk-3NWKPYIG.cjs');
|
|
6
|
-
require('../chunk-IRCFHYKZ.cjs');
|
|
7
|
-
require('../chunk-USNT2KNT.cjs');
|
|
8
60
|
|
|
9
61
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.getLogLevel = _chunk3NWKPYIGcjs.getLogLevel; exports.getLogLevelLabel = _chunk3NWKPYIGcjs.getLogLevelLabel; exports.isVerbose = _chunk3NWKPYIGcjs.isVerbose;
|
|
62
|
+
exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose;
|