@node-cli/logger 0.0.8 → 1.0.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 +20 -7
- package/dist/Logger.d.ts +6 -0
- package/dist/Logger.js +17 -0
- package/dist/Logger.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -28,13 +28,14 @@ log.error("this is an error log");
|
|
|
28
28
|
|
|
29
29
|
Logger relies on `console` behind the scenes, and therefore supports the same [string substitution](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions) capabilities and uses the following methods:
|
|
30
30
|
|
|
31
|
-
| Method
|
|
32
|
-
|
|
|
33
|
-
| debug
|
|
34
|
-
| log
|
|
35
|
-
| info
|
|
36
|
-
| warn
|
|
37
|
-
| error
|
|
31
|
+
| Method | Description | Output color |
|
|
32
|
+
| ------------------ | --------------------------------------------------------- | ------------ |
|
|
33
|
+
| debug | Outputs a message to the console with the log level debug | grey |
|
|
34
|
+
| log | For general output of logging information. | white |
|
|
35
|
+
| info | Informative logging of information. | blue |
|
|
36
|
+
| warn | Outputs a message to the console with the log level debug | yellow |
|
|
37
|
+
| error | Outputs an error message. | red |
|
|
38
|
+
| printErrorsAndExit | Output error message(s) and exit | red |
|
|
38
39
|
|
|
39
40
|
### Options
|
|
40
41
|
|
|
@@ -152,6 +153,18 @@ log.timestamp = false;
|
|
|
152
153
|
log.info("this will be NOT be logged with a timestamp");
|
|
153
154
|
```
|
|
154
155
|
|
|
156
|
+
### Log multiple errors and optionally exit the main program
|
|
157
|
+
|
|
158
|
+
The following will print 2 error messages and exit with error code 666.
|
|
159
|
+
If the second parameter (a number) is not provided, the process does not exit.
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
import { Logger } from "@node-cli/logger";
|
|
163
|
+
const log = new Logger();
|
|
164
|
+
|
|
165
|
+
log.printErrorsAndExit(["Error One!", "Error Two!"], 666);
|
|
166
|
+
```
|
|
167
|
+
|
|
155
168
|
## License
|
|
156
169
|
|
|
157
170
|
MIT © Arno Versini
|
package/dist/Logger.d.ts
CHANGED
|
@@ -15,4 +15,10 @@ export declare class Logger {
|
|
|
15
15
|
debug(...arguments_: any): void;
|
|
16
16
|
warn(...arguments_: any): void;
|
|
17
17
|
error(...arguments_: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* Log multiple error messages at the prompt using `console.error` behind the scenes.
|
|
20
|
+
* @param {string[]} errorMessages array of error message to display line by line
|
|
21
|
+
* @param {number} [exitStatus] the process will exit with this value if provided
|
|
22
|
+
*/
|
|
23
|
+
printErrorsAndExit(errorMessages: string[], exitStatus?: number): void;
|
|
18
24
|
}
|
package/dist/Logger.js
CHANGED
|
@@ -75,6 +75,23 @@ export class Logger {
|
|
|
75
75
|
color: kleur.red
|
|
76
76
|
}, ...arguments_);
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Log multiple error messages at the prompt using `console.error` behind the scenes.
|
|
80
|
+
* @param {string[]} errorMessages array of error message to display line by line
|
|
81
|
+
* @param {number} [exitStatus] the process will exit with this value if provided
|
|
82
|
+
*/ printErrorsAndExit(errorMessages, exitStatus) {
|
|
83
|
+
if (errorMessages && errorMessages.length > 0) {
|
|
84
|
+
this.log();
|
|
85
|
+
for (const message of errorMessages){
|
|
86
|
+
this.error(message);
|
|
87
|
+
}
|
|
88
|
+
this.log();
|
|
89
|
+
if (typeof exitStatus === "number") {
|
|
90
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
91
|
+
process.exit(exitStatus);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
78
95
|
}
|
|
79
96
|
|
|
80
97
|
//# sourceMappingURL=Logger.js.map
|
package/dist/Logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Logger.ts"],"sourcesContent":["import kleur from \"kleur\";\nimport util from \"node:util\";\n\nexport class Logger {\n\t#shouldLog: boolean;\n\t#globalPrefix: string;\n\t#showTimestamp: boolean;\n\t#printOptions: { colors: boolean; compact: boolean; depth: number };\n\n\tconstructor({\n\t\tboring = false,\n\t\tsilent = false,\n\t\tprefix = \"\",\n\t\ttimestamp = false,\n\t} = {}) {\n\t\tthis.#shouldLog = !silent;\n\t\tthis.#globalPrefix = prefix;\n\t\tthis.#showTimestamp = timestamp;\n\t\tthis.#printOptions = {\n\t\t\tcolors: !boring,\n\t\t\tcompact: false,\n\t\t\tdepth: 5,\n\t\t};\n\t}\n\n\tset silent(flag: boolean) {\n\t\tthis.#shouldLog = !flag;\n\t}\n\n\tset boring(flag: boolean) {\n\t\tthis.#printOptions.colors = !flag;\n\t}\n\n\tset prefix(prefix: string) {\n\t\tthis.#globalPrefix = prefix;\n\t}\n\n\tset timestamp(flag: boolean) {\n\t\tthis.#showTimestamp = flag;\n\t}\n\n\t#_log(\n\t\ttype: { method: string | number; color: (argument0: any) => any },\n\t\t...arguments_: string[]\n\t) {\n\t\tif (this.#shouldLog) {\n\t\t\tlet message: string;\n\t\t\tif (!this.#showTimestamp && !this.#globalPrefix) {\n\t\t\t\tmessage = util.formatWithOptions(this.#printOptions, ...arguments_);\n\t\t\t} else {\n\t\t\t\tconst prefix = this.#globalPrefix ? [this.#globalPrefix] : [];\n\t\t\t\tif (this.#showTimestamp) {\n\t\t\t\t\tconst now = new Date();\n\t\t\t\t\tprefix.push(\n\t\t\t\t\t\tthis.#printOptions.colors\n\t\t\t\t\t\t\t? `${kleur.grey(\n\t\t\t\t\t\t\t\t\t`[ ${now.toDateString()} ${now.toLocaleTimeString()} ]`\n\t\t\t\t\t\t\t )}`\n\t\t\t\t\t\t\t: `[ ${now.toDateString()} ${now.toLocaleTimeString()} ]`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tmessage = util.formatWithOptions(\n\t\t\t\t\tthis.#printOptions,\n\t\t\t\t\tprefix.join(\" \"),\n\t\t\t\t\t...arguments_\n\t\t\t\t);\n\t\t\t}\n\t\t\tconsole[type.method](\n\t\t\t\tthis.#printOptions.colors ? `${type.color(message)}` : message\n\t\t\t);\n\t\t}\n\t}\n\n\tinfo(...arguments_: any) {\n\t\tthis.#_log({ method: \"info\", color: kleur.blue }, ...arguments_);\n\t}\n\n\tlog(...arguments_: any) {\n\t\tthis.#_log({ method: \"log\", color: kleur.white }, ...arguments_);\n\t}\n\n\tdebug(...arguments_: any) {\n\t\tthis.#_log({ method: \"debug\", color: kleur.grey }, ...arguments_);\n\t}\n\n\twarn(...arguments_: any) {\n\t\tthis.#_log({ method: \"warn\", color: kleur.yellow }, ...arguments_);\n\t}\n\n\terror(...arguments_: any) {\n\t\tthis.#_log({ method: \"error\", color: kleur.red }, ...arguments_);\n\t}\n}\n"],"names":["kleur","util","Logger","shouldLog","globalPrefix","showTimestamp","printOptions","constructor","boring","silent","prefix","timestamp","colors","compact","depth","flag","_log","type","arguments_","message","formatWithOptions","now","Date","push","grey","toDateString","toLocaleTimeString","join","console","method","color","info","blue","log","white","debug","warn","yellow","error","red"],"mappings":"AAAA,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,UAAU,YAAY;AAE7B,OAAO,MAAMC;IACZ,CAACC,SAAS,CAAU;IACpB,CAACC,YAAY,CAAS;IACtB,CAACC,aAAa,CAAU;IACxB,CAACC,YAAY,CAAuD;IAEpEC,YAAY,EACXC,QAAS,KAAK,CAAA,EACdC,QAAS,KAAK,CAAA,EACdC,QAAS,GAAE,EACXC,WAAY,KAAK,CAAA,EACjB,GAAG,CAAC,CAAC,CAAE;QACP,IAAI,CAAC,CAACR,SAAS,GAAG,CAACM;QACnB,IAAI,CAAC,CAACL,YAAY,GAAGM;QACrB,IAAI,CAAC,CAACL,aAAa,GAAGM;QACtB,IAAI,CAAC,CAACL,YAAY,GAAG;YACpBM,QAAQ,CAACJ;YACTK,SAAS,KAAK;YACdC,OAAO;QACR;IACD;IAEA,IAAIL,OAAOM,IAAa,EAAE;QACzB,IAAI,CAAC,CAACZ,SAAS,GAAG,C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AKa,KAAK,CAACX,SAAS,CAAC,GAAGA,OAAO;QAEhE,CAAC;IACF;IAEAY,KAAK,GAAGb,UAAe,EAAE;QACxB,IAAI,CAAC,CAACF,IAAI,CAAC;YAAEa,QAAQ;YAAQC,OAAO9B,MAAMgC,IAAI;QAAC,MAAMd;IACtD;IAEAe,IAAI,GAAGf,UAAe,EAAE;QACvB,IAAI,CAAC,CAACF,IAAI,CAAC;YAAEa,QAAQ;YAAOC,OAAO9B,MAAMkC,KAAK;QAAC,MAAMhB;IACtD;IAEAiB,MAAM,GAAGjB,UAAe,EAAE;QACzB,IAAI,CAAC,CAACF,IAAI,CAAC;YAAEa,QAAQ;YAASC,OAAO9B,MAAMwB,IAAI;QAAC,MAAMN;IACvD;IAEAkB,KAAK,GAAGlB,UAAe,EAAE;QACxB,IAAI,CAAC,CAACF,IAAI,CAAC;YAAEa,QAAQ;YAAQC,OAAO9B,MAAMqC,MAAM;QAAC,MAAMnB;IACxD;IAEAoB,MAAM,GAAGpB,UAAe,EAAE;QACzB,IAAI,CAAC,CAACF,IAAI,CAAC;YAAEa,QAAQ;YAASC,OAAO9B,MAAMuC,GAAG;QAAC,MAAMrB;IACtD;AACD,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../src/Logger.ts"],"sourcesContent":["import kleur from \"kleur\";\nimport util from \"node:util\";\n\nexport class Logger {\n\t#shouldLog: boolean;\n\t#globalPrefix: string;\n\t#showTimestamp: boolean;\n\t#printOptions: { colors: boolean; compact: boolean; depth: number };\n\n\tconstructor({\n\t\tboring = false,\n\t\tsilent = false,\n\t\tprefix = \"\",\n\t\ttimestamp = false,\n\t} = {}) {\n\t\tthis.#shouldLog = !silent;\n\t\tthis.#globalPrefix = prefix;\n\t\tthis.#showTimestamp = timestamp;\n\t\tthis.#printOptions = {\n\t\t\tcolors: !boring,\n\t\t\tcompact: false,\n\t\t\tdepth: 5,\n\t\t};\n\t}\n\n\tset silent(flag: boolean) {\n\t\tthis.#shouldLog = !flag;\n\t}\n\n\tset boring(flag: boolean) {\n\t\tthis.#printOptions.colors = !flag;\n\t}\n\n\tset prefix(prefix: string) {\n\t\tthis.#globalPrefix = prefix;\n\t}\n\n\tset timestamp(flag: boolean) {\n\t\tthis.#showTimestamp = flag;\n\t}\n\n\t#_log(\n\t\ttype: { method: string | number; color: (argument0: any) => any },\n\t\t...arguments_: string[]\n\t) {\n\t\tif (this.#shouldLog) {\n\t\t\tlet message: string;\n\t\t\tif (!this.#showTimestamp && !this.#globalPrefix) {\n\t\t\t\tmessage = util.formatWithOptions(this.#printOptions, ...arguments_);\n\t\t\t} else {\n\t\t\t\tconst prefix = this.#globalPrefix ? [this.#globalPrefix] : [];\n\t\t\t\tif (this.#showTimestamp) {\n\t\t\t\t\tconst now = new Date();\n\t\t\t\t\tprefix.push(\n\t\t\t\t\t\tthis.#printOptions.colors\n\t\t\t\t\t\t\t? `${kleur.grey(\n\t\t\t\t\t\t\t\t\t`[ ${now.toDateString()} ${now.toLocaleTimeString()} ]`\n\t\t\t\t\t\t\t )}`\n\t\t\t\t\t\t\t: `[ ${now.toDateString()} ${now.toLocaleTimeString()} ]`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tmessage = util.formatWithOptions(\n\t\t\t\t\tthis.#printOptions,\n\t\t\t\t\tprefix.join(\" \"),\n\t\t\t\t\t...arguments_\n\t\t\t\t);\n\t\t\t}\n\t\t\tconsole[type.method](\n\t\t\t\tthis.#printOptions.colors ? `${type.color(message)}` : message\n\t\t\t);\n\t\t}\n\t}\n\n\tinfo(...arguments_: any) {\n\t\tthis.#_log({ method: \"info\", color: kleur.blue }, ...arguments_);\n\t}\n\n\tlog(...arguments_: any) {\n\t\tthis.#_log({ method: \"log\", color: kleur.white }, ...arguments_);\n\t}\n\n\tdebug(...arguments_: any) {\n\t\tthis.#_log({ method: \"debug\", color: kleur.grey }, ...arguments_);\n\t}\n\n\twarn(...arguments_: any) {\n\t\tthis.#_log({ method: \"warn\", color: kleur.yellow }, ...arguments_);\n\t}\n\n\terror(...arguments_: any) {\n\t\tthis.#_log({ method: \"error\", color: kleur.red }, ...arguments_);\n\t}\n\n\t/**\n\t * Log multiple error messages at the prompt using `console.error` behind the scenes.\n\t * @param {string[]} errorMessages array of error message to display line by line\n\t * @param {number} [exitStatus] the process will exit with this value if provided\n\t */\n\tprintErrorsAndExit(errorMessages: string[], exitStatus?: number) {\n\t\tif (errorMessages && errorMessages.length > 0) {\n\t\t\tthis.log();\n\t\t\tfor (const message of errorMessages) {\n\t\t\t\tthis.error(message);\n\t\t\t}\n\t\t\tthis.log();\n\n\t\t\tif (typeof exitStatus === \"number\") {\n\t\t\t\t// eslint-disable-next-line unicorn/no-process-exit\n\t\t\t\tprocess.exit(exitStatus);\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["kleur","util","Logger","shouldLog","globalPrefix","showTimestamp","printOptions","constructor","boring","silent","prefix","timestamp","colors","compact","depth","flag","_log","type","arguments_","message","formatWithOptions","now","Date","push","grey","toDateString","toLocaleTimeString","join","console","method","color","info","blue","log","white","debug","warn","yellow","error","red","printErrorsAndExit","errorMessages","exitStatus","length","process","exit"],"mappings":"AAAA,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,UAAU,YAAY;AAE7B,OAAO,MAAMC;IACZ,CAACC,SAAS,CAAU;IACpB,CAACC,YAAY,CAAS;IACtB,CAACC,aAAa,CAAU;IACxB,CAACC,YAAY,CAAuD;IAEpEC,YAAY,EACXC,QAAS,KAAK,CAAA,EACdC,QAAS,KAAK,CAAA,EACdC,QAAS,GAAE,EACXC,WAAY,KAAK,CAAA,EACjB,GAAG,CAAC,CAAC,CAAE;QACP,IAAI,CAAC,CAACR,SAAS,GAAG,CAACM;QACnB,IAAI,CAAC,CAACL,YAAY,GAAGM;QACrB,IAAI,CAAC,CAACL,aAAa,GAAGM;QACtB,IAAI,CAAC,CAACL,YAAY,GAAG;YACpBM,QAAQ,CAACJ;YACTK,SAAS,KAAK;YACdC,OAAO;QACR;IACD;IAEA,IAA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ger",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"description": "A tiny console logger for nodejs CLI apps",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"types": "./dist/Logger.d.ts",
|
|
9
8
|
"exports": "./dist/Logger.js",
|
|
10
9
|
"files": [
|
|
11
10
|
"dist"
|
|
@@ -15,17 +14,18 @@
|
|
|
15
14
|
"kleur": "4.1.5"
|
|
16
15
|
},
|
|
17
16
|
"scripts": {
|
|
18
|
-
"build": "
|
|
17
|
+
"build": "yarn run clean && yarn run build:types && yarn run build:js && yarn run build:barrel",
|
|
18
|
+
"build:barrel": "barrelsby --delete --directory dist --pattern \"**/*.d.ts\" --name \"index.d\"",
|
|
19
19
|
"build:js": "swc --source-maps --out-dir dist src",
|
|
20
20
|
"build:types": "tsc",
|
|
21
21
|
"clean": "rimraf dist types coverage",
|
|
22
22
|
"lint": "eslint \"src/*.ts\"",
|
|
23
|
-
"test": "jest",
|
|
23
|
+
"test": "cross-env-shell NODE_OPTIONS=--experimental-vm-modules jest",
|
|
24
24
|
"test:coverage": "npm run test -- --coverage",
|
|
25
25
|
"watch": "swc --watch --out-dir dist src"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "fe6401830d153ab91166243c2cafd96f6cc0d9b5"
|
|
31
31
|
}
|