@odg/log 1.19.2 → 1.21.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/{agents.md → AGENTS.md} +5 -6
- package/dist/Enums/LogLevel.js +2 -5
- package/dist/Enums/LogLevel.js.map +1 -1
- package/dist/Interfaces/LogLevelInterface.d.ts +1 -1
- package/dist/Interfaces/LogLevelInterface.d.ts.map +1 -1
- package/dist/Interfaces/LogLevelInterface.js +1 -2
- package/dist/Interfaces/LoggerAwareInterface.d.ts +1 -1
- package/dist/Interfaces/LoggerAwareInterface.d.ts.map +1 -1
- package/dist/Interfaces/LoggerAwareInterface.js +1 -2
- package/dist/Interfaces/LoggerInterface.d.ts +1 -1
- package/dist/Interfaces/LoggerInterface.d.ts.map +1 -1
- package/dist/Interfaces/LoggerInterface.js +1 -2
- package/dist/Interfaces/LoggerPluginInterface.d.ts +2 -2
- package/dist/Interfaces/LoggerPluginInterface.d.ts.map +1 -1
- package/dist/Interfaces/LoggerPluginInterface.js +1 -2
- package/dist/Interfaces/index.d.ts +4 -4
- package/dist/Interfaces/index.d.ts.map +1 -1
- package/dist/Interfaces/index.js +1 -2
- package/dist/Support/format-unknown.d.ts +9 -0
- package/dist/Support/format-unknown.d.ts.map +1 -0
- package/dist/Support/format-unknown.js +52 -0
- package/dist/Support/format-unknown.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -18
- package/dist/index.js.map +1 -1
- package/dist/loggers/AbstractLogger.d.ts +2 -2
- package/dist/loggers/AbstractLogger.d.ts.map +1 -1
- package/dist/loggers/AbstractLogger.js +10 -14
- package/dist/loggers/AbstractLogger.js.map +1 -1
- package/dist/loggers/ConsoleLogger.d.ts +3 -3
- package/dist/loggers/ConsoleLogger.d.ts.map +1 -1
- package/dist/loggers/ConsoleLogger.js +27 -34
- package/dist/loggers/ConsoleLogger.js.map +1 -1
- package/dist/loggers/Logger.d.ts +3 -3
- package/dist/loggers/Logger.d.ts.map +1 -1
- package/dist/loggers/Logger.js +2 -6
- package/dist/loggers/Logger.js.map +1 -1
- package/dist/loggers/NullLogger.d.ts +1 -1
- package/dist/loggers/NullLogger.d.ts.map +1 -1
- package/dist/loggers/NullLogger.js +2 -6
- package/dist/loggers/NullLogger.js.map +1 -1
- package/dist/loggers/StringMessageFormater.d.ts +1 -1
- package/dist/loggers/StringMessageFormater.d.ts.map +1 -1
- package/dist/loggers/StringMessageFormater.js +9 -16
- package/dist/loggers/StringMessageFormater.js.map +1 -1
- package/dist/loggers/index.d.ts +5 -5
- package/dist/loggers/index.d.ts.map +1 -1
- package/dist/loggers/index.js +5 -21
- package/dist/loggers/index.js.map +1 -1
- package/dist/loggers/json-log-formattable.d.ts +1 -1
- package/dist/loggers/json-log-formattable.d.ts.map +1 -1
- package/dist/loggers/json-log-formattable.js +1 -4
- package/dist/loggers/json-log-formattable.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +19 -12
package/{agents.md → AGENTS.md}
RENAMED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# @odg/log - Consumer Guide
|
|
2
2
|
|
|
3
3
|
## 🎯 Purpose
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
- Tipo `JSONLogFormattable` e guarda `isJSONLogFormattable` para reconhecer payloads estruturados.
|
|
5
|
+
- IoC/DI contracts for loggers with pluggable handlers and processors.
|
|
6
|
+
- Base class `AbstractLogger`, and helpers `NullLogger`, `ConsoleLogger`, composite `Logger` (handlers + processors).
|
|
8
7
|
|
|
9
8
|
## 📜 Contracts
|
|
10
9
|
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
- `ConsoleLogger`: escreve no console com rótulo por nível; se `isJSONLogFormattable(message)`, formatação alternativa do conteúdo.
|
|
19
18
|
- `JSONLogFormattable`: campos opcionais `request`, `exception`; `type` é `LogLevel`.
|
|
20
19
|
|
|
21
|
-
##
|
|
20
|
+
## Rules
|
|
22
21
|
|
|
23
22
|
- Preferir `await` em todas as chamadas de log (API inteira é `Promise<void>`).
|
|
24
23
|
- Ao estender `AbstractLogger`, implementar apenas `log(level, message, context?)`.
|
|
@@ -33,4 +32,4 @@
|
|
|
33
32
|
|
|
34
33
|
- `isJSONLogFormattable` valida só `index`, `instance` e `message` como strings; não garante `type`, `createdAt` nem subestruturas — não assumir payload completo só pelo guard.
|
|
35
34
|
- `Logger.log` executa handlers em paralelo (`Promise.all`); falha em um handler rejeita a promessa inteira.
|
|
36
|
-
- `ConsoleLogger` depende de `console.log` e de `
|
|
35
|
+
- `ConsoleLogger` depende de `console.log` e de `ansis` para cores; adequado a dev, não a políticas de produção sem avaliação própria.
|
package/dist/Enums/LogLevel.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogLevel = void 0;
|
|
4
|
-
var LogLevel;
|
|
1
|
+
export var LogLevel;
|
|
5
2
|
(function (LogLevel) {
|
|
6
3
|
LogLevel["EMERGENCY"] = "emergency";
|
|
7
4
|
LogLevel["ALERT"] = "alert";
|
|
@@ -11,5 +8,5 @@ var LogLevel;
|
|
|
11
8
|
LogLevel["NOTICE"] = "notice";
|
|
12
9
|
LogLevel["INFO"] = "info";
|
|
13
10
|
LogLevel["DEBUG"] = "debug";
|
|
14
|
-
})(LogLevel || (
|
|
11
|
+
})(LogLevel || (LogLevel = {}));
|
|
15
12
|
//# sourceMappingURL=LogLevel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogLevel.js","sourceRoot":"","sources":["../../src/Enums/LogLevel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogLevel.js","sourceRoot":"","sources":["../../src/Enums/LogLevel.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;IAChB,mCAAuB,CAAA;IACvB,2BAAe,CAAA;IACf,iCAAqB,CAAA;IACrB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,2BAAe,CAAA;AACnB,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogLevelInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LogLevelInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"LogLevelInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LogLevelInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerAwareInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LoggerAwareInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"LoggerAwareInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LoggerAwareInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;GAIG;AACH,UAAU,oBAAoB;IAE1B;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CAC5C;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LoggerInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"LoggerInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LoggerInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;GAIG;AACH,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C;;;;;;;GAOG;AACH,UAAU,eAAe;IAErB;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElE;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;;;;;;;;OASG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;;;;;;;OAQG;IACH,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9D;;;;;;;OAOG;IACH,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAEhF;AAED,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerPluginInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LoggerPluginInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"LoggerPluginInterface.d.ts","sourceRoot":"","sources":["../../src/Interfaces/LoggerPluginInterface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC3D,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IAElC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC,CAAC;CACzF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type * from "./LoggerAwareInterface";
|
|
2
|
-
export type * from "./LoggerInterface";
|
|
3
|
-
export type * from "./LogLevelInterface";
|
|
4
|
-
export type * from "./LoggerPluginInterface";
|
|
1
|
+
export type * from "./LoggerAwareInterface.ts";
|
|
2
|
+
export type * from "./LoggerInterface.ts";
|
|
3
|
+
export type * from "./LogLevelInterface.ts";
|
|
4
|
+
export type * from "./LoggerPluginInterface.ts";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Interfaces/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Interfaces/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,2BAA2B,CAAC;AAE/C,mBAAmB,sBAAsB,CAAC;AAE1C,mBAAmB,wBAAwB,CAAC;AAE5C,mBAAmB,4BAA4B,CAAC"}
|
package/dist/Interfaces/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stringify an unknown value without depending on `node:util`, so this
|
|
3
|
+
* package stays usable in non-Node runtimes (e.g. bundled for the browser).
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} value Value to stringify
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatUnknown(value: unknown): string;
|
|
9
|
+
//# sourceMappingURL=format-unknown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-unknown.d.ts","sourceRoot":"","sources":["../../src/Support/format-unknown.ts"],"names":[],"mappings":"AA4BA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAapD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Readable placeholder for values `JSON.stringify` would otherwise silently
|
|
3
|
+
* drop (functions, `undefined`, symbols) or throw on (`BigInt`).
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} value Value to describe
|
|
6
|
+
* @returns {string | undefined} Placeholder, or `undefined` if `value` is JSON-safe as-is
|
|
7
|
+
*/
|
|
8
|
+
function describeNonJsonValue(value) {
|
|
9
|
+
if (typeof value === "function")
|
|
10
|
+
return `[Function: ${value.name || "anonymous"}]`;
|
|
11
|
+
if (typeof value === "bigint")
|
|
12
|
+
return `${value}n`;
|
|
13
|
+
if (typeof value === "symbol")
|
|
14
|
+
return value.toString();
|
|
15
|
+
if (typeof value === "undefined")
|
|
16
|
+
return "[undefined]";
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `JSON.stringify` replacer using {@link describeNonJsonValue}, so nested
|
|
21
|
+
* occurrences are kept instead of silently lost from the output.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} _key Property key, unused
|
|
24
|
+
* @param {unknown} value Property value being serialized
|
|
25
|
+
* @returns {unknown}
|
|
26
|
+
*/
|
|
27
|
+
function keepNonJsonValues(_key, value) {
|
|
28
|
+
return describeNonJsonValue(value) ?? value;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Stringify an unknown value without depending on `node:util`, so this
|
|
32
|
+
* package stays usable in non-Node runtimes (e.g. bundled for the browser).
|
|
33
|
+
*
|
|
34
|
+
* @param {unknown} value Value to stringify
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
export function formatUnknown(value) {
|
|
38
|
+
if (typeof value === "string")
|
|
39
|
+
return value;
|
|
40
|
+
if (value instanceof Error)
|
|
41
|
+
return value.stack ?? value.message;
|
|
42
|
+
const placeholder = describeNonJsonValue(value);
|
|
43
|
+
if (placeholder !== undefined)
|
|
44
|
+
return placeholder;
|
|
45
|
+
try {
|
|
46
|
+
return JSON.stringify(value, keepNonJsonValues);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=format-unknown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-unknown.js","sourceRoot":"","sources":["../../src/Support/format-unknown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,SAAS,oBAAoB,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,UAAU;QAAE,OAAO,cAAc,KAAK,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC;IACnF,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,GAAG,KAAK,GAAG,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACvD,IAAI,OAAO,KAAK,KAAK,WAAW;QAAE,OAAO,aAAa,CAAC;IAEvD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,IAAY,EAAE,KAAc;IACnD,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC;IAEhE,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAEhD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAElD,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from "./Enums/LogLevel";
|
|
2
|
-
export type * from "./Interfaces/index";
|
|
3
|
-
export * from "./loggers/index";
|
|
1
|
+
export * from "./Enums/LogLevel.ts";
|
|
2
|
+
export type * from "./Interfaces/index.ts";
|
|
3
|
+
export * from "./loggers/index.ts";
|
|
4
|
+
export * from "./Support/format-unknown.ts";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,mBAAmB,uBAAuB,CAAC;AAE3C,cAAc,oBAAoB,CAAC;AAEnC,cAAc,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Enums/LogLevel"), exports);
|
|
18
|
-
__exportStar(require("./loggers/index"), exports);
|
|
1
|
+
export * from "./Enums/LogLevel.js";
|
|
2
|
+
export * from "./loggers/index.js";
|
|
3
|
+
export * from "./Support/format-unknown.js";
|
|
19
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAIpC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LogLevel } from "../Enums/LogLevel";
|
|
2
|
-
import type { ContextType, LoggerInterface } from "../Interfaces";
|
|
1
|
+
import { LogLevel } from "../Enums/LogLevel.ts";
|
|
2
|
+
import type { ContextType, LoggerInterface } from "../Interfaces/index.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Simple logger implementation
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLogger.d.ts","sourceRoot":"","sources":["../../src/loggers/AbstractLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AbstractLogger.d.ts","sourceRoot":"","sources":["../../src/loggers/AbstractLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;;;GAIG;AACH,8BAAsB,cAAe,YAAW,eAAe;IAE3D;;;;;;OAMG;IACU,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9E;;;;;;;;;OASG;IACU,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E;;;;;;;;OAQG;IACU,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7E;;;;;;;OAOG;IACU,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E;;;;;;;;;OASG;IACU,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5E;;;;;;OAMG;IACU,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E;;;;;;;;OAQG;IACU,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE;;;;;;OAMG;IACU,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E;;;;;;;OAOG;aACa,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAE/F"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbstractLogger = void 0;
|
|
4
|
-
const LogLevel_1 = require("../Enums/LogLevel");
|
|
1
|
+
import { LogLevel } from "../Enums/LogLevel.js";
|
|
5
2
|
/**
|
|
6
3
|
* Simple logger implementation
|
|
7
4
|
*
|
|
8
5
|
* @author Dragons Gamers <https://github.com/ODGodinho>
|
|
9
6
|
*/
|
|
10
|
-
class AbstractLogger {
|
|
7
|
+
export class AbstractLogger {
|
|
11
8
|
/**
|
|
12
9
|
* System is unusable.
|
|
13
10
|
*
|
|
@@ -16,7 +13,7 @@ class AbstractLogger {
|
|
|
16
13
|
* @returns {Promise<void>}
|
|
17
14
|
*/
|
|
18
15
|
async emergency(message, context) {
|
|
19
|
-
return this.log(
|
|
16
|
+
return this.log(LogLevel.EMERGENCY, message, context);
|
|
20
17
|
}
|
|
21
18
|
/**
|
|
22
19
|
* Action must be taken immediately.
|
|
@@ -29,7 +26,7 @@ class AbstractLogger {
|
|
|
29
26
|
* @returns {Promise<void>}
|
|
30
27
|
*/
|
|
31
28
|
async alert(message, context) {
|
|
32
|
-
return this.log(
|
|
29
|
+
return this.log(LogLevel.ALERT, message, context);
|
|
33
30
|
}
|
|
34
31
|
/**
|
|
35
32
|
* Critical conditions.
|
|
@@ -41,7 +38,7 @@ class AbstractLogger {
|
|
|
41
38
|
* @returns {Promise<void>}
|
|
42
39
|
*/
|
|
43
40
|
async critical(message, context) {
|
|
44
|
-
return this.log(
|
|
41
|
+
return this.log(LogLevel.CRITICAL, message, context);
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
44
|
* Runtime errors that do not require immediate action but should typically
|
|
@@ -52,7 +49,7 @@ class AbstractLogger {
|
|
|
52
49
|
* @returns {Promise<void>}
|
|
53
50
|
*/
|
|
54
51
|
async error(message, context) {
|
|
55
|
-
return this.log(
|
|
52
|
+
return this.log(LogLevel.ERROR, message, context);
|
|
56
53
|
}
|
|
57
54
|
/**
|
|
58
55
|
* Exceptional occurrences that are not errors.
|
|
@@ -65,7 +62,7 @@ class AbstractLogger {
|
|
|
65
62
|
* @returns {Promise<void>}
|
|
66
63
|
*/
|
|
67
64
|
async warning(message, context) {
|
|
68
|
-
return this.log(
|
|
65
|
+
return this.log(LogLevel.WARNING, message, context);
|
|
69
66
|
}
|
|
70
67
|
/**
|
|
71
68
|
* Normal but significant events.
|
|
@@ -75,7 +72,7 @@ class AbstractLogger {
|
|
|
75
72
|
* @returns {Promise<void>}
|
|
76
73
|
*/
|
|
77
74
|
async notice(message, context) {
|
|
78
|
-
return this.log(
|
|
75
|
+
return this.log(LogLevel.NOTICE, message, context);
|
|
79
76
|
}
|
|
80
77
|
/**
|
|
81
78
|
* Interesting events.
|
|
@@ -87,7 +84,7 @@ class AbstractLogger {
|
|
|
87
84
|
* @returns {Promise<void>}
|
|
88
85
|
*/
|
|
89
86
|
async info(message, context) {
|
|
90
|
-
return this.log(
|
|
87
|
+
return this.log(LogLevel.INFO, message, context);
|
|
91
88
|
}
|
|
92
89
|
/**
|
|
93
90
|
* Detailed debug information.
|
|
@@ -97,8 +94,7 @@ class AbstractLogger {
|
|
|
97
94
|
* @returns {Promise<void>}
|
|
98
95
|
*/
|
|
99
96
|
async debug(message, context) {
|
|
100
|
-
return this.log(
|
|
97
|
+
return this.log(LogLevel.DEBUG, message, context);
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
|
-
exports.AbstractLogger = AbstractLogger;
|
|
104
100
|
//# sourceMappingURL=AbstractLogger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractLogger.js","sourceRoot":"","sources":["../../src/loggers/AbstractLogger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AbstractLogger.js","sourceRoot":"","sources":["../../src/loggers/AbstractLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD;;;;GAIG;AACH,MAAM,OAAgB,cAAc;IAEhC;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,OAAgB,EAAE,OAAqB;QAC1D,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE,OAAqB;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,QAAQ,CAAC,OAAgB,EAAE,OAAqB;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE,OAAqB;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,OAAO,CAAC,OAAgB,EAAE,OAAqB;QACxD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CAAC,OAAgB,EAAE,OAAqB;QACvD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,IAAI,CAAC,OAAgB,EAAE,OAAqB;QACrD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE,OAAqB;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CAYJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LogLevel } from "../Enums/LogLevel";
|
|
2
|
-
import type { ContextType } from "../Interfaces/LoggerInterface";
|
|
3
|
-
import { AbstractLogger } from "./AbstractLogger";
|
|
1
|
+
import { LogLevel } from "../Enums/LogLevel.ts";
|
|
2
|
+
import type { ContextType } from "../Interfaces/LoggerInterface.ts";
|
|
3
|
+
import { AbstractLogger } from "./AbstractLogger.ts";
|
|
4
4
|
/**
|
|
5
5
|
* This Logger can be used to avoid conditional log calls.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleLogger.d.ts","sourceRoot":"","sources":["../../src/loggers/ConsoleLogger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsoleLogger.d.ts","sourceRoot":"","sources":["../../src/loggers/ConsoleLogger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAE7C;;;;;;;OAOG;IACU,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAa1F,OAAO,CAAC,QAAQ;CAyBnB"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const node_util_1 = __importDefault(require("node:util"));
|
|
8
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const LogLevel_1 = require("../Enums/LogLevel");
|
|
10
|
-
const AbstractLogger_1 = require("./AbstractLogger");
|
|
11
|
-
const json_log_formattable_1 = require("./json-log-formattable");
|
|
12
|
-
const StringMessageFormater_1 = require("./StringMessageFormater");
|
|
1
|
+
import ansis from "ansis";
|
|
2
|
+
import { LogLevel } from "../Enums/LogLevel.js";
|
|
3
|
+
import { formatUnknown } from "../Support/format-unknown.js";
|
|
4
|
+
import { AbstractLogger } from "./AbstractLogger.js";
|
|
5
|
+
import { isJSONLogFormattable } from "./json-log-formattable.js";
|
|
6
|
+
import { StringMessageFormatter } from "./StringMessageFormater.js";
|
|
13
7
|
/**
|
|
14
8
|
* This Logger can be used to avoid conditional log calls.
|
|
15
9
|
*
|
|
@@ -20,7 +14,7 @@ const StringMessageFormater_1 = require("./StringMessageFormater");
|
|
|
20
14
|
*
|
|
21
15
|
* @author Dragons Gamers <https://github.com/ODGodinho>
|
|
22
16
|
*/
|
|
23
|
-
class ConsoleLogger extends
|
|
17
|
+
export class ConsoleLogger extends AbstractLogger {
|
|
24
18
|
/**
|
|
25
19
|
* Logs with an arbitrary level.
|
|
26
20
|
*
|
|
@@ -30,9 +24,9 @@ class ConsoleLogger extends AbstractLogger_1.AbstractLogger {
|
|
|
30
24
|
* @returns {Promise<void>}
|
|
31
25
|
*/
|
|
32
26
|
async log(level, message, _context) {
|
|
33
|
-
let newMessage =
|
|
34
|
-
if (
|
|
35
|
-
const formatter = new
|
|
27
|
+
let newMessage = formatUnknown(message);
|
|
28
|
+
if (isJSONLogFormattable(message)) {
|
|
29
|
+
const formatter = new StringMessageFormatter();
|
|
36
30
|
newMessage = formatter.format(message);
|
|
37
31
|
}
|
|
38
32
|
// eslint-disable-next-line no-console, no-restricted-syntax -- This package used to console.log
|
|
@@ -41,26 +35,25 @@ class ConsoleLogger extends AbstractLogger_1.AbstractLogger {
|
|
|
41
35
|
getLevel(level) {
|
|
42
36
|
const message = ` ${level}: `;
|
|
43
37
|
switch (level) {
|
|
44
|
-
case
|
|
45
|
-
return
|
|
46
|
-
case
|
|
47
|
-
return
|
|
48
|
-
case
|
|
49
|
-
return
|
|
50
|
-
case
|
|
51
|
-
return
|
|
52
|
-
case
|
|
53
|
-
return
|
|
54
|
-
case
|
|
55
|
-
return
|
|
56
|
-
case
|
|
57
|
-
return
|
|
58
|
-
case
|
|
59
|
-
return
|
|
38
|
+
case LogLevel.EMERGENCY:
|
|
39
|
+
return ansis.bgBlack.bold.red(message);
|
|
40
|
+
case LogLevel.ALERT:
|
|
41
|
+
return ansis.bgHex("#FFFCCD").bold.white(message);
|
|
42
|
+
case LogLevel.CRITICAL:
|
|
43
|
+
return ansis.bgHex("#990033").white.bold(message);
|
|
44
|
+
case LogLevel.ERROR:
|
|
45
|
+
return ansis.bgRed.white.bold(message);
|
|
46
|
+
case LogLevel.WARNING:
|
|
47
|
+
return ansis.bgYellow.white(message);
|
|
48
|
+
case LogLevel.NOTICE:
|
|
49
|
+
return ansis.bgBlue.white(message);
|
|
50
|
+
case LogLevel.INFO:
|
|
51
|
+
return ansis.bgCyan.white(message);
|
|
52
|
+
case LogLevel.DEBUG:
|
|
53
|
+
return ansis.bgMagenta.white(message);
|
|
60
54
|
default:
|
|
61
|
-
return
|
|
55
|
+
return ansis.bgGray.white(" unknown: ");
|
|
62
56
|
}
|
|
63
57
|
}
|
|
64
58
|
}
|
|
65
|
-
exports.ConsoleLogger = ConsoleLogger;
|
|
66
59
|
//# sourceMappingURL=ConsoleLogger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleLogger.js","sourceRoot":"","sources":["../../src/loggers/ConsoleLogger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsoleLogger.js","sourceRoot":"","sources":["../../src/loggers/ConsoleLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAE7C;;;;;;;OAOG;IACI,KAAK,CAAC,GAAG,CAAC,KAAe,EAAE,OAAgB,EAAE,QAAsB;QACtE,IAAI,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QAExC,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,SAAS,GAAG,IAAI,sBAAsB,EAAE,CAAC;YAE/C,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QAED,gGAAgG;QAChG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;IAEO,QAAQ,CAAC,KAAe;QAC5B,MAAM,OAAO,GAAG,KAAK,KAAK,KAAK,CAAC;QAEhC,QAAQ,KAAK,EAAE,CAAC;YACZ,KAAK,QAAQ,CAAC,SAAS;gBACnB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3C,KAAK,QAAQ,CAAC,KAAK;gBACf,OAAO,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACtD,KAAK,QAAQ,CAAC,QAAQ;gBAClB,OAAO,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtD,KAAK,QAAQ,CAAC,KAAK;gBACf,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3C,KAAK,QAAQ,CAAC,OAAO;gBACjB,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACzC,KAAK,QAAQ,CAAC,MAAM;gBAChB,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACvC,KAAK,QAAQ,CAAC,IAAI;gBACd,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACvC,KAAK,QAAQ,CAAC,KAAK;gBACf,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC1C;gBACI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAClD,CAAC;IACL,CAAC;CAEJ"}
|
package/dist/loggers/Logger.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LogLevel } from "../Enums/LogLevel";
|
|
2
|
-
import type { LoggerInterface, LoggerPluginInterface } from "../Interfaces";
|
|
3
|
-
import { AbstractLogger } from "./AbstractLogger";
|
|
1
|
+
import type { LogLevel } from "../Enums/LogLevel.ts";
|
|
2
|
+
import type { LoggerInterface, LoggerPluginInterface } from "../Interfaces/index.ts";
|
|
3
|
+
import { AbstractLogger } from "./AbstractLogger.ts";
|
|
4
4
|
export declare class Logger extends AbstractLogger {
|
|
5
5
|
private readonly handlers;
|
|
6
6
|
private readonly processors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/loggers/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/loggers/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAER,eAAe,EAEf,qBAAqB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,MAAO,SAAQ,cAAc;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAElD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAE1D;;;;;OAKG;IACI,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAIjD;;;;OAIG;IACI,WAAW,IAAI,eAAe,EAAE;IAIvC;;;;;OAKG;IACI,aAAa,CAAC,SAAS,EAAE,qBAAqB,GAAG,IAAI;IAI5D;;;;OAIG;IACI,YAAY,IAAI,qBAAqB,EAAE;IAIjC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAYpG;;;;;;;OAOG;YACW,gBAAgB;CA2BjC"}
|
package/dist/loggers/Logger.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Logger = void 0;
|
|
4
|
-
const AbstractLogger_1 = require("./AbstractLogger");
|
|
5
|
-
class Logger extends AbstractLogger_1.AbstractLogger {
|
|
1
|
+
import { AbstractLogger } from "./AbstractLogger.js";
|
|
2
|
+
export class Logger extends AbstractLogger {
|
|
6
3
|
handlers = [];
|
|
7
4
|
processors = [];
|
|
8
5
|
/**
|
|
@@ -72,5 +69,4 @@ class Logger extends AbstractLogger_1.AbstractLogger {
|
|
|
72
69
|
return newParser;
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
|
-
exports.Logger = Logger;
|
|
76
72
|
//# sourceMappingURL=Logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/loggers/Logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/loggers/Logger.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,OAAO,MAAO,SAAQ,cAAc;IAErB,QAAQ,GAAsB,EAAE,CAAC;IAEjC,UAAU,GAA4B,EAAE,CAAC;IAE1D;;;;;OAKG;IACI,WAAW,CAAC,MAAuB;QACtC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACI,WAAW;QACd,OAAO,CAAE,GAAG,IAAI,CAAC,QAAQ,CAAE,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,SAAgC;QACjD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACI,YAAY;QACf,OAAO,CAAE,GAAG,IAAI,CAAC,UAAU,CAAE,CAAC;IAClC,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,KAAe,EAAE,OAAgB,EAAE,OAAgC;QAChF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAEvE,MAAM,OAAO,CAAC,GAAG,CACb,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAwB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAC7D,SAAS,CAAC,KAAK,EACf,SAAS,CAAC,OAAO,EACjB,SAAS,CAAC,OAAO,CACpB,CAAC,CACL,CAAC;IACN,CAAC;IAED;;;;;;;OAOG;IACK,KAAK,CAAC,gBAAgB,CAC1B,KAAe,EACf,OAAgB,EAChB,OAAqB;QAErB,MAAM,QAAQ,GAAG;YACb,KAAK;YACL,OAAO;YACP,OAAO;SACV,CAAC;QACF,IAAI,SAAS,GAA0B;YACnC,QAAQ;YACR,KAAK;YACL,OAAO;YACP,OAAO;SACV,CAAC;QAEF,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACtC,SAAS,GAAG;gBACR,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;gBACpC,QAAQ;aACX,CAAC;QACN,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NullLogger.d.ts","sourceRoot":"","sources":["../../src/loggers/NullLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NullLogger.d.ts","sourceRoot":"","sources":["../../src/loggers/NullLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;;GASG;AACH,qBAAa,UAAW,SAAQ,cAAc;IAE1C;;;;OAIG;IACU,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAIpC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NullLogger = void 0;
|
|
4
|
-
const AbstractLogger_1 = require("./AbstractLogger");
|
|
1
|
+
import { AbstractLogger } from "./AbstractLogger.js";
|
|
5
2
|
/**
|
|
6
3
|
* This Logger can be used to avoid conditional log calls.
|
|
7
4
|
*
|
|
@@ -12,7 +9,7 @@ const AbstractLogger_1 = require("./AbstractLogger");
|
|
|
12
9
|
*
|
|
13
10
|
* @author Dragons Gamers <https://github.com/ODGodinho>
|
|
14
11
|
*/
|
|
15
|
-
class NullLogger extends
|
|
12
|
+
export class NullLogger extends AbstractLogger {
|
|
16
13
|
/**
|
|
17
14
|
* Logs with an arbitrary level.
|
|
18
15
|
*
|
|
@@ -22,5 +19,4 @@ class NullLogger extends AbstractLogger_1.AbstractLogger {
|
|
|
22
19
|
// Not have action
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.NullLogger = NullLogger;
|
|
26
22
|
//# sourceMappingURL=NullLogger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NullLogger.js","sourceRoot":"","sources":["../../src/loggers/NullLogger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NullLogger.js","sourceRoot":"","sources":["../../src/loggers/NullLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,OAAO,UAAW,SAAQ,cAAc;IAE1C;;;;OAIG;IACI,KAAK,CAAC,GAAG;QACZ,kBAAkB;IACtB,CAAC;CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringMessageFormater.d.ts","sourceRoot":"","sources":["../../src/loggers/StringMessageFormater.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StringMessageFormater.d.ts","sourceRoot":"","sources":["../../src/loggers/StringMessageFormater.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,qBAAa,sBAAsB;IAExB,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM;IAUlD,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,kBAAkB;CAoB7B"}
|