@logtape/logtape 0.4.2-dev.50 → 0.4.2-dev.51
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/esm/formatter.js +12 -6
- package/package.json +1 -1
- package/script/formatter.js +35 -6
- package/types/formatter.d.ts.map +1 -1
package/esm/formatter.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as dntShim from "./_dnt.shims.js";
|
|
1
2
|
/**
|
|
2
3
|
* The severity level abbreviations.
|
|
3
4
|
*/
|
|
@@ -16,15 +17,20 @@ const levelAbbreviations = {
|
|
|
16
17
|
* @param value The value to inspect.
|
|
17
18
|
* @returns The string representation of the value.
|
|
18
19
|
*/
|
|
19
|
-
const inspect =
|
|
20
|
-
|
|
20
|
+
const inspect =
|
|
21
|
+
// @ts-ignore: Deno global
|
|
22
|
+
"Deno" in dntShim.dntGlobalThis && "inspect" in globalThis.Deno &&
|
|
23
|
+
// @ts-ignore: Deno global
|
|
21
24
|
typeof globalThis.Deno.inspect === "function"
|
|
25
|
+
// @ts-ignore: Deno global
|
|
22
26
|
? globalThis.Deno.inspect
|
|
23
|
-
:
|
|
27
|
+
// @ts-ignore: Node.js global
|
|
28
|
+
: "util" in dntShim.dntGlobalThis && "inspect" in globalThis.util &&
|
|
29
|
+
// @ts-ignore: Node.js global
|
|
24
30
|
globalThis.util.inspect === "function"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
// @ts-ignore: Node.js global
|
|
32
|
+
? globalThis.util.inspect
|
|
33
|
+
: JSON.stringify;
|
|
28
34
|
/**
|
|
29
35
|
* The default text formatter. This formatter formats log records as follows:
|
|
30
36
|
*
|
package/package.json
CHANGED
package/script/formatter.js
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.defaultConsoleFormatter = exports.defaultTextFormatter = void 0;
|
|
27
|
+
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
4
28
|
/**
|
|
5
29
|
* The severity level abbreviations.
|
|
6
30
|
*/
|
|
@@ -19,15 +43,20 @@ const levelAbbreviations = {
|
|
|
19
43
|
* @param value The value to inspect.
|
|
20
44
|
* @returns The string representation of the value.
|
|
21
45
|
*/
|
|
22
|
-
const inspect =
|
|
23
|
-
|
|
46
|
+
const inspect =
|
|
47
|
+
// @ts-ignore: Deno global
|
|
48
|
+
"Deno" in dntShim.dntGlobalThis && "inspect" in globalThis.Deno &&
|
|
49
|
+
// @ts-ignore: Deno global
|
|
24
50
|
typeof globalThis.Deno.inspect === "function"
|
|
51
|
+
// @ts-ignore: Deno global
|
|
25
52
|
? globalThis.Deno.inspect
|
|
26
|
-
:
|
|
53
|
+
// @ts-ignore: Node.js global
|
|
54
|
+
: "util" in dntShim.dntGlobalThis && "inspect" in globalThis.util &&
|
|
55
|
+
// @ts-ignore: Node.js global
|
|
27
56
|
globalThis.util.inspect === "function"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
57
|
+
// @ts-ignore: Node.js global
|
|
58
|
+
? globalThis.util.inspect
|
|
59
|
+
: JSON.stringify;
|
|
31
60
|
/**
|
|
32
61
|
* The default text formatter. This formatter formats log records as follows:
|
|
33
62
|
*
|
package/types/formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC;AAoC1D;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAW9D;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,OAAO,EAAE,CAAC;AAazE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CA2B7E"}
|