@subsquid/logger 1.0.0 → 1.3.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/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +5 -1
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAI/B,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAA;AAChC,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAI/B,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAA;AAChC,cAAc,UAAU,CAAA;AAaxB,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAEpE"}
|
package/lib/index.js
CHANGED
|
@@ -21,7 +21,10 @@ const pretty_1 = require("./sinks/pretty");
|
|
|
21
21
|
var level_1 = require("./level");
|
|
22
22
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return level_1.LogLevel; } });
|
|
23
23
|
__exportStar(require("./logger"), exports);
|
|
24
|
-
const
|
|
24
|
+
const prettyEnabled = process.env.FORCE_PRETTY_LOGGER ?
|
|
25
|
+
process.env.FORCE_PRETTY_LOGGER !== '0' :
|
|
26
|
+
process.stderr.isTTY;
|
|
27
|
+
const ROOT = new logger_1.Logger(prettyEnabled ? pretty_1.prettyStderrSink : json_1.jsonLinesStderrSink, '');
|
|
25
28
|
function createLogger(ns, attributes) {
|
|
26
29
|
return ROOT.child(ns, attributes);
|
|
27
30
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA+B;AAC/B,uCAAgD;AAChD,2CAA+C;AAE/C,iCAAgC;AAAxB,iGAAA,QAAQ,OAAA;AAChB,2CAAwB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA+B;AAC/B,uCAAgD;AAChD,2CAA+C;AAE/C,iCAAgC;AAAxB,iGAAA,QAAQ,OAAA;AAChB,2CAAwB;AAExB,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAA;AAGxB,MAAM,IAAI,GAAG,IAAI,eAAM,CACnB,aAAa,CAAC,CAAC,CAAC,yBAAgB,CAAC,CAAC,CAAC,0BAAmB,EACtD,EAAE,CACL,CAAA;AAGD,SAAgB,YAAY,CAAC,EAAU,EAAE,UAAmB;IACxD,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,CAAA;AACrC,CAAC;AAFD,oCAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subsquid/logger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Lightweight library for structured logging",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": "git@github.com:subsquid/squid.git",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
],
|
|
14
14
|
"main": "lib/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@subsquid/util-internal-hex": "^1.
|
|
17
|
-
"@subsquid/util-internal-json": "^1.
|
|
16
|
+
"@subsquid/util-internal-hex": "^1.2.0",
|
|
17
|
+
"@subsquid/util-internal-json": "^1.2.0",
|
|
18
18
|
"supports-color": "^8.1.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/mocha": "^10.0.1",
|
|
22
|
-
"@types/node": "^16.
|
|
22
|
+
"@types/node": "^18.16.17",
|
|
23
23
|
"@types/supports-color": "^8.1.1",
|
|
24
24
|
"expect": "^29.5.0",
|
|
25
25
|
"mocha": "^10.2.0",
|
package/src/index.ts
CHANGED
|
@@ -5,9 +5,13 @@ import {prettyStderrSink} from "./sinks/pretty"
|
|
|
5
5
|
export {LogLevel} from "./level"
|
|
6
6
|
export * from "./logger"
|
|
7
7
|
|
|
8
|
+
const prettyEnabled = process.env.FORCE_PRETTY_LOGGER ?
|
|
9
|
+
process.env.FORCE_PRETTY_LOGGER !== '0' :
|
|
10
|
+
process.stderr.isTTY
|
|
11
|
+
|
|
8
12
|
|
|
9
13
|
const ROOT = new Logger(
|
|
10
|
-
|
|
14
|
+
prettyEnabled ? prettyStderrSink : jsonLinesStderrSink,
|
|
11
15
|
''
|
|
12
16
|
)
|
|
13
17
|
|