@punks/backend-core 0.0.54 → 0.0.56
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/dist/cjs/index.js +27 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/logging.d.ts +7 -7
- package/dist/cjs/types/logging/utils.d.ts +2 -0
- package/dist/esm/index.js +27 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/logging.d.ts +7 -7
- package/dist/esm/types/logging/utils.d.ts +2 -0
- package/dist/index.d.ts +7 -7
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare enum LogLevel {
|
|
2
|
-
Debug =
|
|
3
|
-
Info =
|
|
4
|
-
Warn =
|
|
5
|
-
Error =
|
|
6
|
-
Fatal =
|
|
2
|
+
Debug = "debug",
|
|
3
|
+
Info = "info",
|
|
4
|
+
Warn = "warn",
|
|
5
|
+
Error = "error",
|
|
6
|
+
Fatal = "fatal"
|
|
7
7
|
}
|
|
8
8
|
export declare enum MetaSerializationType {
|
|
9
|
-
None =
|
|
10
|
-
JSON =
|
|
9
|
+
None = "none",
|
|
10
|
+
JSON = "json"
|
|
11
11
|
}
|
|
12
12
|
export interface ILoggerProvider {
|
|
13
13
|
debug(loggerName: string, message: string, meta?: any): void;
|
package/dist/esm/index.js
CHANGED
|
@@ -5,16 +5,16 @@ import * as winston from 'winston';
|
|
|
5
5
|
|
|
6
6
|
var LogLevel;
|
|
7
7
|
(function (LogLevel) {
|
|
8
|
-
LogLevel[
|
|
9
|
-
LogLevel[
|
|
10
|
-
LogLevel[
|
|
11
|
-
LogLevel[
|
|
12
|
-
LogLevel[
|
|
8
|
+
LogLevel["Debug"] = "debug";
|
|
9
|
+
LogLevel["Info"] = "info";
|
|
10
|
+
LogLevel["Warn"] = "warn";
|
|
11
|
+
LogLevel["Error"] = "error";
|
|
12
|
+
LogLevel["Fatal"] = "fatal";
|
|
13
13
|
})(LogLevel || (LogLevel = {}));
|
|
14
14
|
var MetaSerializationType;
|
|
15
15
|
(function (MetaSerializationType) {
|
|
16
|
-
MetaSerializationType[
|
|
17
|
-
MetaSerializationType[
|
|
16
|
+
MetaSerializationType["None"] = "none";
|
|
17
|
+
MetaSerializationType["JSON"] = "json";
|
|
18
18
|
})(MetaSerializationType || (MetaSerializationType = {}));
|
|
19
19
|
|
|
20
20
|
const range = (start, end) => {
|
|
@@ -28407,6 +28407,21 @@ const excelParse = (file, options) => {
|
|
|
28407
28407
|
.map((x) => aggregateRow(header, x, options));
|
|
28408
28408
|
};
|
|
28409
28409
|
|
|
28410
|
+
const getLevelValue = (level) => {
|
|
28411
|
+
switch (level) {
|
|
28412
|
+
case LogLevel.Debug:
|
|
28413
|
+
return 0;
|
|
28414
|
+
case LogLevel.Info:
|
|
28415
|
+
return 1;
|
|
28416
|
+
case LogLevel.Warn:
|
|
28417
|
+
return 2;
|
|
28418
|
+
case LogLevel.Error:
|
|
28419
|
+
return 3;
|
|
28420
|
+
case LogLevel.Fatal:
|
|
28421
|
+
return 4;
|
|
28422
|
+
}
|
|
28423
|
+
};
|
|
28424
|
+
|
|
28410
28425
|
class InternalLogger {
|
|
28411
28426
|
constructor(loggerName, container) {
|
|
28412
28427
|
this.loggerName = loggerName;
|
|
@@ -28431,9 +28446,13 @@ class InternalLogger {
|
|
|
28431
28446
|
this.getEnabledInstances(LogLevel.Error).forEach((x) => x.provider.exception(this.loggerName, message, error, this.serializeMeta(x.options, meta)));
|
|
28432
28447
|
}
|
|
28433
28448
|
getEnabledInstances(level) {
|
|
28434
|
-
return this.container.instances.filter((x) => x.options.enabled &&
|
|
28449
|
+
return this.container.instances.filter((x) => x.options.enabled &&
|
|
28450
|
+
getLevelValue(x.options.level) <= getLevelValue(level));
|
|
28435
28451
|
}
|
|
28436
28452
|
serializeMeta(options, meta) {
|
|
28453
|
+
if (meta && typeof meta === "string") {
|
|
28454
|
+
return meta;
|
|
28455
|
+
}
|
|
28437
28456
|
const serializedMeta = meta
|
|
28438
28457
|
? jsonSerialize(meta, {
|
|
28439
28458
|
prettify: true,
|