nightingale-console 13.0.0 → 14.0.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [14.0.1](https://github.com/christophehurpeau/nightingale/compare/v14.0.0...v14.0.1) (2023-06-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add missing type in exports for latest typescript ([8897fd6](https://github.com/christophehurpeau/nightingale/commit/8897fd6fcbd25975482fd1549277b73ed725e53c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [14.0.0](https://github.com/christophehurpeau/nightingale/compare/v13.0.0...v14.0.0) (2023-06-30)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* **deps:** require node 18
|
|
21
|
+
* requires node 18
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* requires node 18 ([4452b11](https://github.com/christophehurpeau/nightingale/commit/4452b116188e58c293be85e462e04922f7ad51f0))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Miscellaneous Chores
|
|
29
|
+
|
|
30
|
+
* **deps:** update dependency @pob/root to v8 ([#760](https://github.com/christophehurpeau/nightingale/issues/760)) ([22dc3cc](https://github.com/christophehurpeau/nightingale/commit/22dc3cceabdfd465d04ee36fec8fdac31febab69))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
# [13.0.0](https://github.com/christophehurpeau/nightingale/compare/v12.1.4...v13.0.0) (2022-11-19)
|
|
7
35
|
|
|
8
36
|
|
|
@@ -2,7 +2,7 @@ import { Level } from 'nightingale-levels';
|
|
|
2
2
|
import type { IsHandling, Handle, LogRecord, Metadata, Handler } from 'nightingale-types';
|
|
3
3
|
export interface ConsoleHandlerOptions {
|
|
4
4
|
formatter?: <T extends Metadata>(record: LogRecord<T>) => string;
|
|
5
|
-
output?: <T extends Metadata>(param: string | string
|
|
5
|
+
output?: <T extends Metadata>(param: string[] | string, record: LogRecord<T>) => void;
|
|
6
6
|
theme?: 'dark' | 'light';
|
|
7
7
|
}
|
|
8
8
|
export declare class ConsoleHandler implements Handler {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,mBAAmB,CAAC;AAmB3B,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IACjE,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,mBAAmB,CAAC;AAmB3B,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IACjE,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAC1B,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EACxB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IAEV,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,qBAAa,cAAe,YAAW,OAAO;IAC5C,QAAQ,EAAE,KAAK,CAAa;IAE5B,UAAU,EAAE,UAAU,CAAC;IAEvB,MAAM,EAAE,MAAM,CAAC;gBAEH,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAE,qBAA0B;CAMjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-node18.mjs","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport formatterANSI from 'nightingale-ansi-formatter';\nimport consoleOutput from 'nightingale-console-output';\nimport { createFindDebugLevel } from 'nightingale-debug';\nimport formatterJSON from 'nightingale-json-formatter';\nimport { Level } from 'nightingale-levels';\nimport type {\n IsHandling,\n Handle,\n LogRecord,\n Metadata,\n Handler,\n} from 'nightingale-types';\n\nconst defaultFormatter =\n POB_TARGET === 'node' &&\n !process.stdout.isTTY &&\n process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi'\n ? formatterJSON\n : formatterANSI;\n\nconst createHandle = (\n formatter = defaultFormatter,\n output = consoleOutput,\n): Handle => {\n return <T extends Metadata>(record: LogRecord<T>): void => {\n output(formatter(record), record);\n };\n};\nconst findDebugLevel = createFindDebugLevel(process.env.DEBUG);\n\nexport interface ConsoleHandlerOptions {\n formatter?: <T extends Metadata>(record: LogRecord<T>) => string;\n output?: <T extends Metadata>(\n param: string[] | string,\n record: LogRecord<T>,\n ) => void;\n // compat with nightingale-app-console, not used yet\n theme?: 'dark' | 'light';\n}\n\nexport class ConsoleHandler implements Handler {\n minLevel: Level = Level.ALL;\n\n isHandling: IsHandling;\n\n handle: Handle;\n\n constructor(minLevel: Level, options: ConsoleHandlerOptions = {}) {\n this.minLevel = minLevel;\n this.isHandling = (level: Level, key: string) =>\n level >= findDebugLevel(minLevel, key);\n this.handle = createHandle(options.formatter, options.output);\n }\n}\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","minLevel","Level","ALL","constructor","options","isHandling","level","key","handle"],"mappings":";;;;;;AAcA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAM,CAACC,KAAK,IACrBF,OAAO,CAACG,GAAG,CAACC,6BAA6B,KAAK,MAAM,GAChDC,aAAa,GACbC,aAAa,CAAA;AAEnB,MAAMC,YAAY,GAAGA,CACnBC,SAAS,GAAGT,gBAAgB,EAC5BU,MAAM,GAAGC,aAAa,KACX;AACX,EAAA,OAA4BC,MAAoB,IAAW;AACzDF,IAAAA,MAAM,CAACD,SAAS,CAACG,MAAM,CAAC,EAAEA,MAAM,CAAC,CAAA;GAClC,CAAA;AACH,CAAC,CAAA;AACD,MAAMC,cAAc,GAAGC,oBAAoB,CAACb,OAAO,CAACG,GAAG,CAACW,KAAK,CAAC,CAAA;AAYvD,MAAMC,cAAc,CAAoB;EAC7CC,QAAQ,GAAUC,KAAK,CAACC,GAAG,CAAA;AAM3BC,EAAAA,WAAWA,CAACH,QAAe,EAAEI,OAA8B,GAAG,EAAE,EAAE;IAChE,IAAI,CAACJ,QAAQ,GAAGA,QAAQ,CAAA;AACxB,IAAA,IAAI,CAACK,UAAU,GAAG,CAACC,KAAY,EAAEC,GAAW,KAC1CD,KAAK,IAAIV,cAAc,CAACI,QAAQ,EAAEO,GAAG,CAAC,CAAA;AACxC,IAAA,IAAI,CAACC,MAAM,GAAGjB,YAAY,CAACa,OAAO,CAACZ,SAAS,EAAEY,OAAO,CAACX,MAAM,CAAC,CAAA;AAC/D,GAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-console",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.1",
|
|
4
4
|
"description": "Console handler for nightingale",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -16,22 +16,23 @@
|
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=18.12.0"
|
|
20
20
|
},
|
|
21
|
-
"main": "./dist/index-
|
|
21
|
+
"main": "./dist/index-node18.mjs",
|
|
22
22
|
"types": "./dist/definitions/index.d.ts",
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
|
25
25
|
".": {
|
|
26
|
+
"type": "./dist/definitions/index.d.ts",
|
|
26
27
|
"node": {
|
|
27
|
-
"import": "./dist/index-
|
|
28
|
+
"import": "./dist/index-node18.mjs"
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
"sideEffects": false,
|
|
32
33
|
"scripts": {
|
|
33
34
|
"build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
|
|
34
|
-
"build:definitions": "tsc -p",
|
|
35
|
+
"build:definitions": "tsc -p tsconfig.json",
|
|
35
36
|
"clean": "yarn clean:build",
|
|
36
37
|
"clean:build": "pob-babel-clean-out dist",
|
|
37
38
|
"lint": "yarn run lint:eslint",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"babelEnvs": [
|
|
44
45
|
{
|
|
45
46
|
"target": "node",
|
|
46
|
-
"version": "
|
|
47
|
+
"version": "18"
|
|
47
48
|
}
|
|
48
49
|
],
|
|
49
50
|
"entries": [
|
|
@@ -51,18 +52,18 @@
|
|
|
51
52
|
]
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
|
-
"@types/node": ">=
|
|
55
|
-
"nightingale-ansi-formatter": "
|
|
56
|
-
"nightingale-console-output": "
|
|
57
|
-
"nightingale-debug": "
|
|
58
|
-
"nightingale-json-formatter": "
|
|
59
|
-
"nightingale-levels": "
|
|
60
|
-
"nightingale-types": "
|
|
55
|
+
"@types/node": ">=18.0.0",
|
|
56
|
+
"nightingale-ansi-formatter": "14.0.1",
|
|
57
|
+
"nightingale-console-output": "14.0.1",
|
|
58
|
+
"nightingale-debug": "14.0.1",
|
|
59
|
+
"nightingale-json-formatter": "14.0.1",
|
|
60
|
+
"nightingale-levels": "14.0.1",
|
|
61
|
+
"nightingale-types": "14.0.1"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
|
-
"@babel/core": "7.
|
|
64
|
-
"pob-babel": "
|
|
65
|
-
"typescript": "
|
|
64
|
+
"@babel/core": "7.22.5",
|
|
65
|
+
"pob-babel": "36.1.0",
|
|
66
|
+
"typescript": "5.1.6"
|
|
66
67
|
},
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "e012fc159ceae0db482198c3f0308e0fc6470ae1"
|
|
68
69
|
}
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ const findDebugLevel = createFindDebugLevel(process.env.DEBUG);
|
|
|
32
32
|
export interface ConsoleHandlerOptions {
|
|
33
33
|
formatter?: <T extends Metadata>(record: LogRecord<T>) => string;
|
|
34
34
|
output?: <T extends Metadata>(
|
|
35
|
-
param: string | string
|
|
35
|
+
param: string[] | string,
|
|
36
36
|
record: LogRecord<T>,
|
|
37
37
|
) => void;
|
|
38
38
|
// compat with nightingale-app-console, not used yet
|