1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.debug = exports.info = exports.warn = exports.configure = exports.level = exports.LEVEL_SILLY = exports.LEVEL_VERBOSE = exports.LEVEL_INFO = exports.Level = void 0;
|
4 | var Level;
|
5 | (function (Level) {
|
6 | Level[Level["WARN"] = -1] = "WARN";
|
7 | Level[Level["QUIET"] = 0] = "QUIET";
|
8 | Level[Level["INFO"] = 1] = "INFO";
|
9 | Level[Level["VERBOSE"] = 2] = "VERBOSE";
|
10 | Level[Level["SILLY"] = 3] = "SILLY";
|
11 | })(Level = exports.Level || (exports.Level = {}));
|
12 | exports.LEVEL_INFO = Level.INFO;
|
13 | exports.LEVEL_VERBOSE = Level.VERBOSE;
|
14 | exports.LEVEL_SILLY = Level.SILLY;
|
15 |
|
16 | exports.level = Level.QUIET;
|
17 | function configure({ level: newLevel }) {
|
18 | exports.level = newLevel;
|
19 | }
|
20 | exports.configure = configure;
|
21 | function warn(fmt, ...args) {
|
22 | log(Level.WARN, fmt, ...args);
|
23 | }
|
24 | exports.warn = warn;
|
25 | function info(fmt, ...args) {
|
26 | log(Level.INFO, fmt, ...args);
|
27 | }
|
28 | exports.info = info;
|
29 | function debug(fmt, ...args) {
|
30 | log(Level.VERBOSE, fmt, ...args);
|
31 | }
|
32 | exports.debug = debug;
|
33 | function log(messageLevel, fmt, ...args) {
|
34 | if (exports.level >= messageLevel) {
|
35 | const levelName = Level[messageLevel];
|
36 | console.error(`[jsii-pacmak] [${levelName}]`, fmt, ...args);
|
37 | }
|
38 | }
|
39 |
|
\ | No newline at end of file |