@contember/logger 2.1.0-alpha.36 → 2.1.0-alpha.39

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.
Files changed (114) hide show
  1. package/dist/development/index.cjs +23 -0
  2. package/dist/development/index.cjs.map +1 -0
  3. package/dist/development/index.js +23 -0
  4. package/dist/development/index.js.map +1 -0
  5. package/dist/development/src/formatting.cjs +65 -0
  6. package/dist/development/src/formatting.cjs.map +1 -0
  7. package/dist/development/src/formatting.js +65 -0
  8. package/dist/development/src/formatting.js.map +1 -0
  9. package/dist/development/src/handlers/FingerCrossedLoggerHandler.cjs +68 -0
  10. package/dist/development/src/handlers/FingerCrossedLoggerHandler.cjs.map +1 -0
  11. package/dist/development/src/handlers/FingerCrossedLoggerHandler.js +68 -0
  12. package/dist/development/src/handlers/FingerCrossedLoggerHandler.js.map +1 -0
  13. package/dist/development/src/handlers/JsonStreamLoggerHandler.cjs +32 -0
  14. package/dist/development/src/handlers/JsonStreamLoggerHandler.cjs.map +1 -0
  15. package/dist/development/src/handlers/JsonStreamLoggerHandler.js +32 -0
  16. package/dist/development/src/handlers/JsonStreamLoggerHandler.js.map +1 -0
  17. package/dist/development/src/handlers/LoggerHandlerList.cjs +25 -0
  18. package/dist/development/src/handlers/LoggerHandlerList.cjs.map +1 -0
  19. package/dist/development/src/handlers/LoggerHandlerList.js +25 -0
  20. package/dist/development/src/handlers/LoggerHandlerList.js.map +1 -0
  21. package/dist/development/src/handlers/NullLoggerHandler.cjs +13 -0
  22. package/dist/development/src/handlers/NullLoggerHandler.cjs.map +1 -0
  23. package/dist/development/src/handlers/NullLoggerHandler.js +13 -0
  24. package/dist/development/src/handlers/NullLoggerHandler.js.map +1 -0
  25. package/dist/development/src/handlers/PrettyPrintLoggerHandler.cjs +79 -0
  26. package/dist/development/src/handlers/PrettyPrintLoggerHandler.cjs.map +1 -0
  27. package/dist/development/src/handlers/PrettyPrintLoggerHandler.js +79 -0
  28. package/dist/development/src/handlers/PrettyPrintLoggerHandler.js.map +1 -0
  29. package/dist/development/src/handlers/TestLoggerHandler.cjs +24 -0
  30. package/dist/development/src/handlers/TestLoggerHandler.cjs.map +1 -0
  31. package/dist/development/src/handlers/TestLoggerHandler.js +24 -0
  32. package/dist/development/src/handlers/TestLoggerHandler.js.map +1 -0
  33. package/dist/development/src/impl.cjs +109 -0
  34. package/dist/development/src/impl.cjs.map +1 -0
  35. package/dist/development/src/impl.js +109 -0
  36. package/dist/development/src/impl.js.map +1 -0
  37. package/dist/development/src/levels.cjs +11 -0
  38. package/dist/development/src/levels.cjs.map +1 -0
  39. package/dist/development/src/levels.js +11 -0
  40. package/dist/development/src/levels.js.map +1 -0
  41. package/dist/development/src/proxy.cjs +54 -0
  42. package/dist/development/src/proxy.cjs.map +1 -0
  43. package/dist/development/src/proxy.js +54 -0
  44. package/dist/development/src/proxy.js.map +1 -0
  45. package/dist/production/index.cjs +23 -0
  46. package/dist/production/index.cjs.map +1 -0
  47. package/dist/production/index.js +23 -0
  48. package/dist/production/index.js.map +1 -0
  49. package/dist/production/src/formatting.cjs +65 -0
  50. package/dist/production/src/formatting.cjs.map +1 -0
  51. package/dist/production/src/formatting.js +65 -0
  52. package/dist/production/src/formatting.js.map +1 -0
  53. package/dist/production/src/handlers/FingerCrossedLoggerHandler.cjs +68 -0
  54. package/dist/production/src/handlers/FingerCrossedLoggerHandler.cjs.map +1 -0
  55. package/dist/production/src/handlers/FingerCrossedLoggerHandler.js +68 -0
  56. package/dist/production/src/handlers/FingerCrossedLoggerHandler.js.map +1 -0
  57. package/dist/production/src/handlers/JsonStreamLoggerHandler.cjs +32 -0
  58. package/dist/production/src/handlers/JsonStreamLoggerHandler.cjs.map +1 -0
  59. package/dist/production/src/handlers/JsonStreamLoggerHandler.js +32 -0
  60. package/dist/production/src/handlers/JsonStreamLoggerHandler.js.map +1 -0
  61. package/dist/production/src/handlers/LoggerHandlerList.cjs +25 -0
  62. package/dist/production/src/handlers/LoggerHandlerList.cjs.map +1 -0
  63. package/dist/production/src/handlers/LoggerHandlerList.js +25 -0
  64. package/dist/production/src/handlers/LoggerHandlerList.js.map +1 -0
  65. package/dist/production/src/handlers/NullLoggerHandler.cjs +13 -0
  66. package/dist/production/src/handlers/NullLoggerHandler.cjs.map +1 -0
  67. package/dist/production/src/handlers/NullLoggerHandler.js +13 -0
  68. package/dist/production/src/handlers/NullLoggerHandler.js.map +1 -0
  69. package/dist/production/src/handlers/PrettyPrintLoggerHandler.cjs +79 -0
  70. package/dist/production/src/handlers/PrettyPrintLoggerHandler.cjs.map +1 -0
  71. package/dist/production/src/handlers/PrettyPrintLoggerHandler.js +79 -0
  72. package/dist/production/src/handlers/PrettyPrintLoggerHandler.js.map +1 -0
  73. package/dist/production/src/handlers/TestLoggerHandler.cjs +24 -0
  74. package/dist/production/src/handlers/TestLoggerHandler.cjs.map +1 -0
  75. package/dist/production/src/handlers/TestLoggerHandler.js +24 -0
  76. package/dist/production/src/handlers/TestLoggerHandler.js.map +1 -0
  77. package/dist/production/src/impl.cjs +109 -0
  78. package/dist/production/src/impl.cjs.map +1 -0
  79. package/dist/production/src/impl.js +109 -0
  80. package/dist/production/src/impl.js.map +1 -0
  81. package/dist/production/src/levels.cjs +11 -0
  82. package/dist/production/src/levels.cjs.map +1 -0
  83. package/dist/production/src/levels.js +11 -0
  84. package/dist/production/src/levels.js.map +1 -0
  85. package/dist/production/src/proxy.cjs +54 -0
  86. package/dist/production/src/proxy.cjs.map +1 -0
  87. package/dist/production/src/proxy.js +54 -0
  88. package/dist/production/src/proxy.js.map +1 -0
  89. package/dist/types/formatting.d.ts +9 -0
  90. package/dist/types/formatting.d.ts.map +1 -0
  91. package/dist/types/handlers/FingerCrossedLoggerHandler.d.ts +20 -0
  92. package/dist/types/handlers/FingerCrossedLoggerHandler.d.ts.map +1 -0
  93. package/dist/types/handlers/JsonStreamLoggerHandler.d.ts +13 -0
  94. package/dist/types/handlers/JsonStreamLoggerHandler.d.ts.map +1 -0
  95. package/dist/types/handlers/LoggerHandlerList.d.ts +10 -0
  96. package/dist/types/handlers/LoggerHandlerList.d.ts.map +1 -0
  97. package/dist/types/handlers/NullLoggerHandler.d.ts +7 -0
  98. package/dist/types/handlers/NullLoggerHandler.d.ts.map +1 -0
  99. package/dist/types/handlers/PrettyPrintLoggerHandler.d.ts +27 -0
  100. package/dist/types/handlers/PrettyPrintLoggerHandler.d.ts.map +1 -0
  101. package/dist/types/handlers/TestLoggerHandler.d.ts +10 -0
  102. package/dist/types/handlers/TestLoggerHandler.d.ts.map +1 -0
  103. package/dist/types/impl.d.ts +28 -0
  104. package/dist/types/impl.d.ts.map +1 -0
  105. package/dist/types/index.d.ts +11 -0
  106. package/dist/types/index.d.ts.map +1 -0
  107. package/dist/types/levels.d.ts +8 -0
  108. package/dist/types/levels.d.ts.map +1 -0
  109. package/dist/types/proxy.d.ts +5 -0
  110. package/dist/types/proxy.d.ts.map +1 -0
  111. package/dist/types/tsconfig.tsbuildinfo +1 -0
  112. package/dist/types/types.d.ts +55 -0
  113. package/dist/types/types.d.ts.map +1 -0
  114. package/package.json +3 -3
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const node_util = require("node:util");
4
+ const formatLoggerAttributes = (parentAttributes, ownAttributes) => {
5
+ const formattedAttributes = {};
6
+ let formattedLine = "";
7
+ for (const key in ownAttributes) {
8
+ const value = ownAttributes[key];
9
+ if (value === void 0) {
10
+ continue;
11
+ }
12
+ const formattedKey = stringify(key);
13
+ const formattedValue = stringify(value);
14
+ formattedAttributes[formattedKey] = formattedValue;
15
+ formattedLine += `, ${formattedKey}: ${formattedValue}`;
16
+ }
17
+ const parentFormattedAttributes = parentAttributes?.formattedAttributes;
18
+ for (const key in parentFormattedAttributes) {
19
+ if (!(key in formattedAttributes)) {
20
+ const formattedValue = parentFormattedAttributes[key];
21
+ formattedAttributes[key] = formattedValue;
22
+ formattedLine += `, ${key}: ${formattedValue}`;
23
+ }
24
+ }
25
+ return { formattedAttributes, formattedLine };
26
+ };
27
+ const formatLogEntryAttributes = (attributes, entry) => {
28
+ let entryAttributes = "";
29
+ let reformatRest = false;
30
+ const omitInRest = {};
31
+ for (const key in entry.ownAttributes) {
32
+ const value = entry.ownAttributes[key];
33
+ if (value === void 0) {
34
+ continue;
35
+ }
36
+ const formattedKey = stringify(key);
37
+ const formattedValue = stringify(value);
38
+ entryAttributes += `, ${formattedKey}: ${formattedValue}`;
39
+ if (key in attributes.formattedAttributes) {
40
+ reformatRest = true;
41
+ omitInRest[formattedKey] = true;
42
+ }
43
+ }
44
+ if (reformatRest) {
45
+ for (const key in attributes.formattedAttributes) {
46
+ if (!(key in omitInRest)) {
47
+ entryAttributes += `, ${key}: ${attributes.formattedAttributes[key]}`;
48
+ }
49
+ }
50
+ } else {
51
+ entryAttributes += attributes.formattedLine;
52
+ }
53
+ return entryAttributes;
54
+ };
55
+ const stringify = (value) => {
56
+ try {
57
+ return JSON.stringify(value);
58
+ } catch {
59
+ return JSON.stringify(node_util.inspect(value));
60
+ }
61
+ };
62
+ exports.formatLogEntryAttributes = formatLogEntryAttributes;
63
+ exports.formatLoggerAttributes = formatLoggerAttributes;
64
+ exports.stringify = stringify;
65
+ //# sourceMappingURL=formatting.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.cjs","sources":["../../../../packages/logger/src/formatting.ts"],"sourcesContent":["import { LogEntry, LoggerAttributes } from './types'\nimport { inspect } from 'node:util'\n\nexport type FormattedAttributes = {\n\tformattedAttributes: Record<string, string>\n\tformattedLine: string\n}\n\nexport const formatLoggerAttributes = (parentAttributes: FormattedAttributes | undefined, ownAttributes: LoggerAttributes): FormattedAttributes => {\n\tconst formattedAttributes: Record<string, string> = {}\n\tlet formattedLine = ''\n\tfor (const key in ownAttributes) {\n\t\tconst value = ownAttributes[key]\n\t\tif (value === undefined) {\n\t\t\tcontinue\n\t\t}\n\t\tconst formattedKey = stringify(key)\n\t\tconst formattedValue = stringify(value)\n\t\tformattedAttributes[formattedKey] = formattedValue\n\t\tformattedLine += `, ${formattedKey}: ${formattedValue}`\n\t}\n\tconst parentFormattedAttributes = parentAttributes?.formattedAttributes\n\tfor (const key in parentFormattedAttributes) {\n\t\tif (!(key in formattedAttributes)) {\n\t\t\tconst formattedValue = parentFormattedAttributes[key]\n\t\t\tformattedAttributes[key] = formattedValue\n\t\t\tformattedLine += `, ${key}: ${formattedValue}`\n\t\t}\n\t}\n\treturn { formattedAttributes, formattedLine }\n}\n\nexport const formatLogEntryAttributes = (attributes: FormattedAttributes, entry: LogEntry): string => {\n\tlet entryAttributes = ''\n\tlet reformatRest = false\n\tconst omitInRest: Record<string, boolean> = {}\n\n\tfor (const key in entry.ownAttributes) {\n\t\tconst value = entry.ownAttributes[key]\n\t\tif (value === undefined) {\n\t\t\tcontinue\n\t\t}\n\t\tconst formattedKey = stringify(key)\n\t\tconst formattedValue = stringify(value)\n\t\tentryAttributes += `, ${formattedKey}: ${formattedValue}`\n\t\tif (key in attributes.formattedAttributes) {\n\t\t\treformatRest = true\n\t\t\tomitInRest[formattedKey] = true\n\t\t}\n\t}\n\tif (reformatRest) {\n\t\tfor (const key in attributes.formattedAttributes) {\n\t\t\tif (!(key in omitInRest)) {\n\t\t\t\tentryAttributes += `, ${key}: ${attributes.formattedAttributes[key]}`\n\t\t\t}\n\t\t}\n\t} else {\n\t\tentryAttributes += attributes.formattedLine\n\t}\n\n\treturn entryAttributes\n}\n\nexport const stringify = (value: unknown) => {\n\ttry {\n\t\treturn JSON.stringify(value)\n\t} catch {\n\t\treturn JSON.stringify(inspect(value))\n\t}\n}\n"],"names":["inspect"],"mappings":";;;AAQO,MAAM,yBAAyB,CAAC,kBAAmD,kBAAyD;AAClJ,QAAM,sBAA8C,CAAA;AACpD,MAAI,gBAAgB;AACpB,aAAW,OAAO,eAAe;AAChC,UAAM,QAAQ,cAAc,GAAG;AAC/B,QAAI,UAAU,QAAW;AACxB;AAAA,IACD;AACA,UAAM,eA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ggerAttributes = (parentAttributes, ownAttributes) => {
3
+ const formattedAttributes = {};
4
+ let formattedLine = "";
5
+ for (const key in ownAttributes) {
6
+ const value = ownAttributes[key];
7
+ if (value === void 0) {
8
+ continue;
9
+ }
10
+ const formattedKey = stringify(key);
11
+ const formattedValue = stringify(value);
12
+ formattedAttributes[formattedKey] = formattedValue;
13
+ formattedLine += `, ${formattedKey}: ${formattedValue}`;
14
+ }
15
+ const parentFormattedAttributes = parentAttributes?.formattedAttributes;
16
+ for (const key in parentFormattedAttributes) {
17
+ if (!(key in formattedAttributes)) {
18
+ const formattedValue = parentFormattedAttributes[key];
19
+ formattedAttributes[key] = formattedValue;
20
+ formattedLine += `, ${key}: ${formattedValue}`;
21
+ }
22
+ }
23
+ return { formattedAttributes, formattedLine };
24
+ };
25
+ const formatLogEntryAttributes = (attributes, entry) => {
26
+ let entryAttributes = "";
27
+ let reformatRest = false;
28
+ const omitInRest = {};
29
+ for (const key in entry.ownAttributes) {
30
+ const value = entry.ownAttributes[key];
31
+ if (value === void 0) {
32
+ continue;
33
+ }
34
+ const formattedKey = stringify(key);
35
+ const formattedValue = stringify(value);
36
+ entryAttributes += `, ${formattedKey}: ${formattedValue}`;
37
+ if (key in attributes.formattedAttributes) {
38
+ reformatRest = true;
39
+ omitInRest[formattedKey] = true;
40
+ }
41
+ }
42
+ if (reformatRest) {
43
+ for (const key in attributes.formattedAttributes) {
44
+ if (!(key in omitInRest)) {
45
+ entryAttributes += `, ${key}: ${attributes.formattedAttributes[key]}`;
46
+ }
47
+ }
48
+ } else {
49
+ entryAttributes += attributes.formattedLine;
50
+ }
51
+ return entryAttributes;
52
+ };
53
+ const stringify = (value) => {
54
+ try {
55
+ return JSON.stringify(value);
56
+ } catch {
57
+ return JSON.stringify(inspect(value));
58
+ }
59
+ };
60
+ export {
61
+ formatLogEntryAttributes,
62
+ formatLoggerAttributes,
63
+ stringify
64
+ };
65
+ //# sourceMappingURL=formatting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting.js","sources":["../../../../packages/logger/src/formatting.ts"],"sourcesContent":["import { LogEntry, LoggerAttributes } from './types'\nimport { inspect } from 'node:util'\n\nexport type FormattedAttributes = {\n\tformattedAttributes: Record<string, string>\n\tformattedLine: string\n}\n\nexport const formatLoggerAttributes = (parentAttributes: FormattedAttributes | undefined, ownAttributes: LoggerAttributes): FormattedAttributes => {\n\tconst formattedAttributes: Record<string, string> = {}\n\tlet formattedLine = ''\n\tfor (const key in ownAttributes) {\n\t\tconst value = ownAttributes[key]\n\t\tif (value === undefined) {\n\t\t\tcontinue\n\t\t}\n\t\tconst formattedKey = stringify(key)\n\t\tconst formattedValue = stringify(value)\n\t\tformattedAttributes[formattedKey] = formattedValue\n\t\tformattedLine += `, ${formattedKey}: ${formattedValue}`\n\t}\n\tconst parentFormattedAttributes = parentAttributes?.formattedAttributes\n\tfor (const key in parentFormattedAttributes) {\n\t\tif (!(key in formattedAttributes)) {\n\t\t\tconst formattedValue = parentFormattedAttributes[key]\n\t\t\tformattedAttributes[key] = formattedValue\n\t\t\tformattedLine += `, ${key}: ${formattedValue}`\n\t\t}\n\t}\n\treturn { formattedAttributes, formattedLine }\n}\n\nexport const formatLogEntryAttributes = (attributes: FormattedAttributes, entry: LogEntry): string => {\n\tlet entryAttributes = ''\n\tlet reformatRest = false\n\tconst omitInRest: Record<string, boolean> = {}\n\n\tfor (const key in entry.ownAttributes) {\n\t\tconst value = entry.ownAttributes[key]\n\t\tif (value === undefined) {\n\t\t\tcontinue\n\t\t}\n\t\tconst formattedKey = stringify(key)\n\t\tconst formattedValue = stringify(value)\n\t\tentryAttributes += `, ${formattedKey}: ${formattedValue}`\n\t\tif (key in attributes.formattedAttributes) {\n\t\t\treformatRest = true\n\t\t\tomitInRest[formattedKey] = true\n\t\t}\n\t}\n\tif (reformatRest) {\n\t\tfor (const key in attributes.formattedAttributes) {\n\t\t\tif (!(key in omitInRest)) {\n\t\t\t\tentryAttributes += `, ${key}: ${attributes.formattedAttributes[key]}`\n\t\t\t}\n\t\t}\n\t} else {\n\t\tentryAttributes += attributes.formattedLine\n\t}\n\n\treturn entryAttributes\n}\n\nexport const stringify = (value: unknown) => {\n\ttry {\n\t\treturn JSON.stringify(value)\n\t} catch {\n\t\treturn JSON.stringify(inspect(value))\n\t}\n}\n"],"names":[],"mappings":";AAQO,MAAM,yBAAyB,CAAC,kBAAmD,kBAAyD;AAClJ,QAAM,sBAA8C,CAAA;AACpD,MAAI,gBAAgB;AACpB,aAAW,OAAO,eAAe;AAChC,UAAM,QAAQ,cAAc,GAAG;AAC/B,QAAI,UAAU,QAAW;AACxB;AAAA,IACD;AACA,UAAM,eAAe,UAAU,GAAG;AAClC,UAAM,iBAAiB,UAAU,KAAK;AACtC,wBAAoB,YAAY,IAAI;AACpC,qBAAiB,KAAK,YAAY,KAAK,cAAc;AAAA,EACtD;AACA,QAAM,4BAA4B,kBAAkB;AACpD,aAAW,OAAO,2BAA2B;AAC5C,QAAI,EAAE,OAAO,sBAAsB;AAClC,YAAM,iBAAiB,0BAA0B,GAAG;AACpD,0BAAoB,GAAG,IAAI;AAC3B,uBAAiB,KAAK,GAAG,KAAK,cAAc;AAAA,IAC7C;AAAA,EACD;AACA,SAAO,EAAE,qBAAqB,cAAA;AAC/B;AAEO,MAAM,2BAA2B,CAAC,YAAiC,UAA4B;AACrG,MAAI,kBAAkB;AACtB,MAAI,eAAe;AACnB,QAAM,aAAsC,CAAA;AAE5C,aAAW,OAAO,MAAM,eAAe;AACtC,UAAM,QAAQ,MAAM,cAAc,GAAG;AACrC,QAAI,UAAU,QAAW;AACxB;AAAA,IACD;AACA,UAAM,eAAe,UAAU,GAAG;AAClC,UAAM,iBAAiB,UAAU,KAAK;AACtC,uBAAmB,KAAK,YAAY,KAAK,cAAc;AACvD,QAAI,OAAO,WAAW,qBAAqB;AAC1C,qBAAe;AACf,iBAAW,YAAY,IAAI;AAAA,IAC5B;AAAA,EACD;AACA,MAAI,cAAc;AACjB,eAAW,OAAO,WAAW,qBAAqB;AACjD,UAAI,EAAE,OAAO,aAAa;AACzB,2BAAmB,KAAK,GAAG,KAAK,WAAW,oBAAoB,GAAG,CAAC;AAAA,MACpE;AAAA,IACD;AAAA,EACD,OAAO;AACN,uBAAmB,WAAW;AAAA,EAC/B;AAEA,SAAO;AACR;AAEO,MAAM,YAAY,CAAC,UAAmB;AAC5C,MAAI;AACH,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B,QAAQ;AACP,WAAO,KAAK,UAAU,QAAQ,KAAK,CAAC;AAAA,EACrC;AACD;"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const levels = require("../levels.cjs");
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
+ class FingerCrossedLoggerHandler {
8
+ constructor(inner, options = {}) {
9
+ this.inner = inner;
10
+ __publicField(this, "buffer", []);
11
+ __publicField(this, "active", false);
12
+ __publicField(this, "options");
13
+ this.options = {
14
+ logAlwaysLevel: levels.LogLevels.info,
15
+ logWhenActivatedLevel: levels.LogLevels.debug,
16
+ activationLevel: levels.LogLevels.warn,
17
+ maxBufferSize: 100,
18
+ ...options
19
+ };
20
+ if (this.options.logAlwaysLevel.value < this.options.logWhenActivatedLevel.value) {
21
+ this.options.logWhenActivatedLevel = this.options.logAlwaysLevel;
22
+ }
23
+ }
24
+ static factory(options = {}) {
25
+ return (current, globalOptions) => new FingerCrossedLoggerHandler(current, { ...globalOptions.fingerCrossedOptions, ...options });
26
+ }
27
+ getMinLevel() {
28
+ return this.options.logWhenActivatedLevel.value;
29
+ }
30
+ handle(logEntry) {
31
+ const logEntryLevel = logEntry.level.value;
32
+ if (logEntryLevel < this.options.logWhenActivatedLevel.value) {
33
+ return;
34
+ }
35
+ if (this.active) {
36
+ this.inner.handle(logEntry);
37
+ } else if (logEntryLevel >= this.options.activationLevel.value) {
38
+ this.active = true;
39
+ this.doFlush(this.options.logWhenActivatedLevel);
40
+ this.inner.handle(logEntry);
41
+ } else if (this.buffer.length === 0 && logEntryLevel >= this.options.logAlwaysLevel.value) {
42
+ this.inner.handle(logEntry);
43
+ } else {
44
+ this.buffer.push(logEntry);
45
+ if (this.buffer.length >= this.options.maxBufferSize) {
46
+ const first = this.buffer.shift();
47
+ if (first !== void 0 && first.level.value >= this.options.logAlwaysLevel.value) {
48
+ this.inner.handle(first);
49
+ }
50
+ }
51
+ }
52
+ }
53
+ close() {
54
+ this.doFlush(this.options.logAlwaysLevel);
55
+ this.inner.close?.();
56
+ }
57
+ doFlush(minLevel) {
58
+ const entries = this.buffer;
59
+ this.buffer = [];
60
+ for (const entry of entries) {
61
+ if (entry.level.value >= minLevel.value) {
62
+ this.inner.handle(entry);
63
+ }
64
+ }
65
+ }
66
+ }
67
+ exports.FingerCrossedLoggerHandler = FingerCrossedLoggerHandler;
68
+ //# sourceMappingURL=FingerCrossedLoggerHandler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FingerCrossedLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/FingerCrossedLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LoggerHandlerFactory, LogLevel } from '../types'\nimport { LogLevels } from '../levels'\n\nexport interface FingerCrossedLoggerHandlerOptions {\n\tlogAlwaysLevel: LogLevel\n\tlogWhenActivatedLevel: LogLevel\n\tactivationLevel: LogLevel\n\tmaxBufferSize: number\n}\n\nexport class FingerCrossedLoggerHandler implements LoggerHandler {\n\tprivate buffer: LogEntry[] = []\n\n\tprivate active: boolean = false\n\tprivate options: FingerCrossedLoggerHandlerOptions\n\n\tconstructor(\n\t\tprivate readonly inner: LoggerHandler,\n\t\toptions: Partial<FingerCrossedLoggerHandlerOptions> = {},\n\t) {\n\t\tthis.options = {\n\t\t\tlogAlwaysLevel: LogLevels.info,\n\t\t\tlogWhenActivatedLevel: LogLevels.debug,\n\t\t\tactivationLevel: LogLevels.warn,\n\t\t\tmaxBufferSize: 100,\n\t\t\t...options,\n\t\t}\n\t\tif (this.options.logAlwaysLevel.value < this.options.logWhenActivatedLevel.value) {\n\t\t\tthis.options.logWhenActivatedLevel = this.options.logAlwaysLevel\n\t\t}\n\t}\n\n\tpublic static factory(options: Partial<FingerCrossedLoggerHandlerOptions> = {}): LoggerHandlerFactory {\n\t\treturn (current, globalOptions) => new FingerCrossedLoggerHandler(current, { ...globalOptions.fingerCrossedOptions, ...options })\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn this.options.logWhenActivatedLevel.value\n\t}\n\n\thandle(logEntry: LogEntry): void {\n\t\tconst logEntryLevel = logEntry.level.value\n\t\tif (logEntryLevel < this.options.logWhenActivatedLevel.value) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.active) {\n\t\t\tthis.inner.handle(logEntry)\n\t\t} else if (logEntryLevel >= this.options.activationLevel.value) {\n\t\t\tthis.active = true\n\t\t\tthis.doFlush(this.options.logWhenActivatedLevel)\n\t\t\tthis.inner.handle(logEntry)\n\t\t} else if (this.buffer.length === 0 && logEntryLevel >= this.options.logAlwaysLevel.value) {\n\t\t\tthis.inner.handle(logEntry)\n\t\t} else {\n\t\t\tthis.buffer.push(logEntry)\n\n\t\t\tif (this.buffer.length >= this.options.maxBufferSize) {\n\t\t\t\tconst first = this.buffer.shift()\n\t\t\t\tif (first !== undefined && first.level.value >= this.options.logAlwaysLevel.value) {\n\t\t\t\t\tthis.inner.handle(first)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tclose(): void {\n\t\tthis.doFlush(this.options.logAlwaysLevel)\n\t\tthis.inner.close?.()\n\t}\n\n\tprivate doFlush(minLevel: LogLevel) {\n\t\tconst entries = this.buffer\n\t\tthis.buffer = []\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.level.value >= minLevel.value) {\n\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AK,OAAO,KAAK,QAAQ;AAEzB,UAAI,KAAK,OAAO,UAAU,KAAK,QAAQ,eAAe;AACrD,cAAM,QAAQ,KAAK,OAAO,MAAA;AAC1B,YAAI,UAAU,UAAa,MAAM,MAAM,SAAS,KAAK,QAAQ,eAAe,OAAO;AAClF,eAAK,MAAM,OAAO,KAAK;AAAA,QACxB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,QAAc;AACb,SAAK,QAAQ,KAAK,QAAQ,cAAc;AACxC,SAAK,MAAM,QAAA;AAAA,EACZ;AAAA,EAEQ,QAAQ,UAAoB;AACnC,UAAM,UAAU,KAAK;AACrB,SAAK,SAAS,CAAA;AACd,eAAW,SAAS,SAAS;AAC5B,UAAI,MAAM,MAAM,SAAS,SAAS,OAAO;AACxC,aAAK,MAAM,OAAO,KAAK;AAAA,MACxB;AAAA,IACD;AAAA,EACD;AACD;;"}
@@ -0,0 +1,68 @@
1
+ import { LogLevels } from "../levels.js";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ class FingerCrossedLoggerHandler {
6
+ constructor(inner, options = {}) {
7
+ this.inner = inner;
8
+ __publicField(this, "buffer", []);
9
+ __publicField(this, "active", false);
10
+ __publicField(this, "options");
11
+ this.options = {
12
+ logAlwaysLevel: LogLevels.info,
13
+ logWhenActivatedLevel: LogLevels.debug,
14
+ activationLevel: LogLevels.warn,
15
+ maxBufferSize: 100,
16
+ ...options
17
+ };
18
+ if (this.options.logAlwaysLevel.value < this.options.logWhenActivatedLevel.value) {
19
+ this.options.logWhenActivatedLevel = this.options.logAlwaysLevel;
20
+ }
21
+ }
22
+ static factory(options = {}) {
23
+ return (current, globalOptions) => new FingerCrossedLoggerHandler(current, { ...globalOptions.fingerCrossedOptions, ...options });
24
+ }
25
+ getMinLevel() {
26
+ return this.options.logWhenActivatedLevel.value;
27
+ }
28
+ handle(logEntry) {
29
+ const logEntryLevel = logEntry.level.value;
30
+ if (logEntryLevel < this.options.logWhenActivatedLevel.value) {
31
+ return;
32
+ }
33
+ if (this.active) {
34
+ this.inner.handle(logEntry);
35
+ } else if (logEntryLevel >= this.options.activationLevel.value) {
36
+ this.active = true;
37
+ this.doFlush(this.options.logWhenActivatedLevel);
38
+ this.inner.handle(logEntry);
39
+ } else if (this.buffer.length === 0 && logEntryLevel >= this.options.logAlwaysLevel.value) {
40
+ this.inner.handle(logEntry);
41
+ } else {
42
+ this.buffer.push(logEntry);
43
+ if (this.buffer.length >= this.options.maxBufferSize) {
44
+ const first = this.buffer.shift();
45
+ if (first !== void 0 && first.level.value >= this.options.logAlwaysLevel.value) {
46
+ this.inner.handle(first);
47
+ }
48
+ }
49
+ }
50
+ }
51
+ close() {
52
+ this.doFlush(this.options.logAlwaysLevel);
53
+ this.inner.close?.();
54
+ }
55
+ doFlush(minLevel) {
56
+ const entries = this.buffer;
57
+ this.buffer = [];
58
+ for (const entry of entries) {
59
+ if (entry.level.value >= minLevel.value) {
60
+ this.inner.handle(entry);
61
+ }
62
+ }
63
+ }
64
+ }
65
+ export {
66
+ FingerCrossedLoggerHandler
67
+ };
68
+ //# sourceMappingURL=FingerCrossedLoggerHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FingerCrossedLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/FingerCrossedLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LoggerHandlerFactory, LogLevel } from '../types'\nimport { LogLevels } from '../levels'\n\nexport interface FingerCrossedLoggerHandlerOptions {\n\tlogAlwaysLevel: LogLevel\n\tlogWhenActivatedLevel: LogLevel\n\tactivationLevel: LogLevel\n\tmaxBufferSize: number\n}\n\nexport class FingerCrossedLoggerHandler implements LoggerHandler {\n\tprivate buffer: LogEntry[] = []\n\n\tprivate active: boolean = false\n\tprivate options: FingerCrossedLoggerHandlerOptions\n\n\tconstructor(\n\t\tprivate readonly inner: LoggerHandler,\n\t\toptions: Partial<FingerCrossedLoggerHandlerOptions> = {},\n\t) {\n\t\tthis.options = {\n\t\t\tlogAlwaysLevel: LogLevels.info,\n\t\t\tlogWhenActivatedLevel: LogLevels.debug,\n\t\t\tactivationLevel: LogLevels.warn,\n\t\t\tmaxBufferSize: 100,\n\t\t\t...options,\n\t\t}\n\t\tif (this.options.logAlwaysLevel.value < this.options.logWhenActivatedLevel.value) {\n\t\t\tthis.options.logWhenActivatedLevel = this.options.logAlwaysLevel\n\t\t}\n\t}\n\n\tpublic static factory(options: Partial<FingerCrossedLoggerHandlerOptions> = {}): LoggerHandlerFactory {\n\t\treturn (current, globalOptions) => new FingerCrossedLoggerHandler(current, { ...globalOptions.fingerCrossedOptions, ...options })\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn this.options.logWhenActivatedLevel.value\n\t}\n\n\thandle(logEntry: LogEntry): void {\n\t\tconst logEntryLevel = logEntry.level.value\n\t\tif (logEntryLevel < this.options.logWhenActivatedLevel.value) {\n\t\t\treturn\n\t\t}\n\n\t\tif (this.active) {\n\t\t\tthis.inner.handle(logEntry)\n\t\t} else if (logEntryLevel >= this.options.activationLevel.value) {\n\t\t\tthis.active = true\n\t\t\tthis.doFlush(this.options.logWhenActivatedLevel)\n\t\t\tthis.inner.handle(logEntry)\n\t\t} else if (this.buffer.length === 0 && logEntryLevel >= this.options.logAlwaysLevel.value) {\n\t\t\tthis.inner.handle(logEntry)\n\t\t} else {\n\t\t\tthis.buffer.push(logEntry)\n\n\t\t\tif (this.buffer.length >= this.options.maxBufferSize) {\n\t\t\t\tconst first = this.buffer.shift()\n\t\t\t\tif (first !== undefined && first.level.value >= this.options.logAlwaysLevel.value) {\n\t\t\t\t\tthis.inner.handle(first)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tclose(): void {\n\t\tthis.doFlush(this.options.logAlwaysLevel)\n\t\tthis.inner.close?.()\n\t}\n\n\tprivate doFlush(minLevel: LogLevel) {\n\t\tconst entries = this.buffer\n\t\tthis.buffer = []\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.level.value >= minLevel.value) {\n\t\t\t\tthis.inner.handle(entry)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAUO,MAAM,2BAAoD;AAAA,EAMhE,YACkB,OACjB,UAAsD,IACrD;AAFgB,SAAA,QAAA;AANlB,kBAAA,MAAQ,UAAqB,EAAC;AAE9B,kBAAA,MAAQ,UAAkB,KAAA;AAC1B,kBAAA,MAAQ,SAAA;AAMP,SAAK,UAAU;AAAA,MACd,gBAAgB,UAAU;AAAA,MAC1B,uBAAuB,UAAU;AAAA,MACjC,iBAAiB,UAAU;AAAA,MAC3B,eAAe;AAAA,MACf,GAAG;AAAA,IAAA;AAEJ,QAAI,KAAK,QAAQ,eAAe,QAAQ,KAAK,QAAQ,sBAAsB,OAAO;AACjF,WAAK,QAAQ,wBAAwB,KAAK,QAAQ;AAAA,IACnD;AAAA,EACD;AAAA,EAEA,OAAc,QAAQ,UAAsD,IAA0B;AACrG,WAAO,CAAC,SAAS,kBAAkB,IAAI,2BAA2B,SAAS,EAAE,GAAG,cAAc,sBAAsB,GAAG,SAAS;AAAA,EACjI;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,QAAQ,sBAAsB;AAAA,EAC3C;AAAA,EAEA,OAAO,UAA0B;AAChC,UAAM,gBAAgB,SAAS,MAAM;AACrC,QAAI,gBAAgB,KAAK,QAAQ,sBAAsB,OAAO;AAC7D;AAAA,IACD;AAEA,QAAI,KAAK,QAAQ;AAChB,WAAK,MAAM,OAAO,QAAQ;AAAA,IAC3B,WAAW,iBAAiB,KAAK,QAAQ,gBAAgB,OAAO;AAC/D,WAAK,SAAS;AACd,WAAK,QAAQ,KAAK,QAAQ,qBAAqB;AAC/C,WAAK,MAAM,OAAO,QAAQ;AAAA,IAC3B,WAAW,KAAK,OAAO,WAAW,KAAK,iBAAiB,KAAK,QAAQ,eAAe,OAAO;AAC1F,WAAK,MAAM,OAAO,QAAQ;AAAA,IAC3B,OAAO;AACN,WAAK,OAAO,KAAK,QAAQ;AAEzB,UAAI,KAAK,OAAO,UAAU,KAAK,QAAQ,eAAe;AACrD,cAAM,QAAQ,KAAK,OAAO,MAAA;AAC1B,YAAI,UAAU,UAAa,MAAM,MAAM,SAAS,KAAK,QAAQ,eAAe,OAAO;AAClF,eAAK,MAAM,OAAO,KAAK;AAAA,QACxB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,QAAc;AACb,SAAK,QAAQ,KAAK,QAAQ,cAAc;AACxC,SAAK,MAAM,QAAA;AAAA,EACZ;AAAA,EAEQ,QAAQ,UAAoB;AACnC,UAAM,UAAU,KAAK;AACrB,SAAK,SAAS,CAAA;AACd,eAAW,SAAS,SAAS;AAC5B,UAAI,MAAM,MAAM,SAAS,SAAS,OAAO;AACxC,aAAK,MAAM,OAAO,KAAK;AAAA,MACxB;AAAA,IACD;AAAA,EACD;AACD;"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const levels = require("../levels.cjs");
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
7
+ class JsonStreamLoggerHandler {
8
+ constructor(stream, options = {}) {
9
+ this.stream = stream;
10
+ __publicField(this, "options");
11
+ this.options = {
12
+ logLevel: levels.LogLevels.debug,
13
+ ...options
14
+ };
15
+ }
16
+ handle(entry) {
17
+ if (entry.level.value < this.options.logLevel.value) {
18
+ return;
19
+ }
20
+ const formatted = entry.format();
21
+ const line = `{"time": "${entry.isoTime}", "level": "${entry.level.name}", "message": ${formatted.message}${formatted.error}${formatted.attributes}}
22
+ `;
23
+ this.stream.write(line);
24
+ }
25
+ getMinLevel() {
26
+ return this.options.logLevel.value;
27
+ }
28
+ close() {
29
+ }
30
+ }
31
+ exports.JsonStreamLoggerHandler = JsonStreamLoggerHandler;
32
+ //# sourceMappingURL=JsonStreamLoggerHandler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonStreamLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/JsonStreamLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LogLevel } from '../types'\nimport { LogLevels } from '../levels'\n\nexport interface JsonStreamLoggerHandlerOptions {\n\tlogLevel: LogLevel\n}\n\nexport class JsonStreamLoggerHandler implements LoggerHandler {\n\tprivate options: JsonStreamLoggerHandlerOptions\n\n\tconstructor(\n\t\tprivate readonly stream: NodeJS.WritableStream,\n\t\toptions: Partial<JsonStreamLoggerHandlerOptions> = {},\n\t) {\n\t\tthis.options = {\n\t\t\tlogLevel: LogLevels.debug,\n\t\t\t...options,\n\t\t}\n\t}\n\n\thandle(entry: LogEntry): void {\n\t\tif (entry.level.value < this.options.logLevel.value) {\n\t\t\treturn\n\t\t}\n\t\tconst formatted = entry.format()\n\t\tconst line =\n\t\t\t`{\"time\": \"${entry.isoTime}\", \"level\": \"${entry.level.name}\", \"message\": ${formatted.message}${formatted.error}${formatted.attributes}}\\n`\n\t\tthis.stream.write(line)\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn this.options.logLevel.value\n\t}\n\n\tclose(): void {\n\t}\n}\n"],"names":["LogLevels"],"mappings":";;;;;;AAOO,MAAM,wBAAiD;AAAA,EAG7D,YACkB,QACjB,UAAmD,IAClD;AAFgB,SAAA,SAAA;AAHlB,kBAAA,MAAQ,SAAA;AAMP,SAAK,UAAU;AAAA,MACd,UAAUA,OAAAA,UAAU;AAAA,MACpB,GAAG;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,OAAO,OAAuB;AAC7B,QAAI,MAAM,MAAM,QAAQ,KAAK,QAAQ,SAAS,OAAO;AACpD;AAAA,IACD;AACA,UAAM,YAAY,MAAM,OAAA;AACxB,UAAM,OACL,aAAa,MAAM,OAAO,gBAAgB,MAAM,MAAM,IAAI,iBAAiB,UAAU,OAAO,GAAG,UAAU,KAAK,GAAG,UAAU,UAAU;AAAA;AACtI,SAAK,OAAO,MAAM,IAAI;AAAA,EACvB;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,QAAQ,SAAS;AAAA,EAC9B;AAAA,EAEA,QAAc;AAAA,EACd;AACD;;"}
@@ -0,0 +1,32 @@
1
+ import { LogLevels } from "../levels.js";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
5
+ class JsonStreamLoggerHandler {
6
+ constructor(stream, options = {}) {
7
+ this.stream = stream;
8
+ __publicField(this, "options");
9
+ this.options = {
10
+ logLevel: LogLevels.debug,
11
+ ...options
12
+ };
13
+ }
14
+ handle(entry) {
15
+ if (entry.level.value < this.options.logLevel.value) {
16
+ return;
17
+ }
18
+ const formatted = entry.format();
19
+ const line = `{"time": "${entry.isoTime}", "level": "${entry.level.name}", "message": ${formatted.message}${formatted.error}${formatted.attributes}}
20
+ `;
21
+ this.stream.write(line);
22
+ }
23
+ getMinLevel() {
24
+ return this.options.logLevel.value;
25
+ }
26
+ close() {
27
+ }
28
+ }
29
+ export {
30
+ JsonStreamLoggerHandler
31
+ };
32
+ //# sourceMappingURL=JsonStreamLoggerHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonStreamLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/JsonStreamLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LogLevel } from '../types'\nimport { LogLevels } from '../levels'\n\nexport interface JsonStreamLoggerHandlerOptions {\n\tlogLevel: LogLevel\n}\n\nexport class JsonStreamLoggerHandler implements LoggerHandler {\n\tprivate options: JsonStreamLoggerHandlerOptions\n\n\tconstructor(\n\t\tprivate readonly stream: NodeJS.WritableStream,\n\t\toptions: Partial<JsonStreamLoggerHandlerOptions> = {},\n\t) {\n\t\tthis.options = {\n\t\t\tlogLevel: LogLevels.debug,\n\t\t\t...options,\n\t\t}\n\t}\n\n\thandle(entry: LogEntry): void {\n\t\tif (entry.level.value < this.options.logLevel.value) {\n\t\t\treturn\n\t\t}\n\t\tconst formatted = entry.format()\n\t\tconst line =\n\t\t\t`{\"time\": \"${entry.isoTime}\", \"level\": \"${entry.level.name}\", \"message\": ${formatted.message}${formatted.error}${formatted.attributes}}\\n`\n\t\tthis.stream.write(line)\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn this.options.logLevel.value\n\t}\n\n\tclose(): void {\n\t}\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,wBAAiD;AAAA,EAG7D,YACkB,QACjB,UAAmD,IAClD;AAFgB,SAAA,SAAA;AAHlB,kBAAA,MAAQ,SAAA;AAMP,SAAK,UAAU;AAAA,MACd,UAAU,UAAU;AAAA,MACpB,GAAG;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,OAAO,OAAuB;AAC7B,QAAI,MAAM,MAAM,QAAQ,KAAK,QAAQ,SAAS,OAAO;AACpD;AAAA,IACD;AACA,UAAM,YAAY,MAAM,OAAA;AACxB,UAAM,OACL,aAAa,MAAM,OAAO,gBAAgB,MAAM,MAAM,IAAI,iBAAiB,UAAU,OAAO,GAAG,UAAU,KAAK,GAAG,UAAU,UAAU;AAAA;AACtI,SAAK,OAAO,MAAM,IAAI;AAAA,EACvB;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,QAAQ,SAAS;AAAA,EAC9B;AAAA,EAEA,QAAc;AAAA,EACd;AACD;"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ class LoggerHandlerList {
4
+ constructor(transports = []) {
5
+ this.transports = transports;
6
+ }
7
+ getMinLevel() {
8
+ return Math.min(Number.MAX_SAFE_INTEGER, ...this.transports.map((it) => it.getMinLevel()));
9
+ }
10
+ addHandler(transport) {
11
+ this.transports.push(transport);
12
+ }
13
+ handle(logEntry) {
14
+ for (const transport of this.transports) {
15
+ transport.handle(logEntry);
16
+ }
17
+ }
18
+ close() {
19
+ for (const transport of this.transports) {
20
+ transport.close();
21
+ }
22
+ }
23
+ }
24
+ exports.LoggerHandlerList = LoggerHandlerList;
25
+ //# sourceMappingURL=LoggerHandlerList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoggerHandlerList.cjs","sources":["../../../../../packages/logger/src/handlers/LoggerHandlerList.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types'\n\nexport class LoggerHandlerList implements LoggerHandler {\n\tconstructor(\n\t\tprivate readonly transports: LoggerHandler[] = [],\n\t) {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn Math.min(Number.MAX_SAFE_INTEGER, ...this.transports.map(it => it.getMinLevel()))\n\t}\n\n\tpublic addHandler(transport: LoggerHandler) {\n\t\tthis.transports.push(transport)\n\t}\n\n\thandle(logEntry: LogEntry) {\n\t\tfor (const transport of this.transports) {\n\t\t\ttransport.handle(logEntry)\n\t\t}\n\t}\n\n\tclose(): void {\n\t\tfor (const transport of this.transports) {\n\t\t\ttransport.close()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAEO,MAAM,kBAA2C;AAAA,EACvD,YACkB,aAA8B,IAC9C;AADgB,SAAA,aAAA;AAAA,EAElB;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,IAAI,OAAO,kBAAkB,GAAG,KAAK,WAAW,IAAI,CAAA,OAAM,GAAG,YAAA,CAAa,CAAC;AAAA,EACxF;AAAA,EAEO,WAAW,WAA0B;AAC3C,SAAK,WAAW,KAAK,SAAS;AAAA,EAC/B;AAAA,EAEA,OAAO,UAAoB;AAC1B,eAAW,aAAa,KAAK,YAAY;AACxC,gBAAU,OAAO,QAAQ;AAAA,IAC1B;AAAA,EACD;AAAA,EAEA,QAAc;AACb,eAAW,aAAa,KAAK,YAAY;AACxC,gBAAU,MAAA;AAAA,IACX;AAAA,EACD;AACD;;"}
@@ -0,0 +1,25 @@
1
+ class LoggerHandlerList {
2
+ constructor(transports = []) {
3
+ this.transports = transports;
4
+ }
5
+ getMinLevel() {
6
+ return Math.min(Number.MAX_SAFE_INTEGER, ...this.transports.map((it) => it.getMinLevel()));
7
+ }
8
+ addHandler(transport) {
9
+ this.transports.push(transport);
10
+ }
11
+ handle(logEntry) {
12
+ for (const transport of this.transports) {
13
+ transport.handle(logEntry);
14
+ }
15
+ }
16
+ close() {
17
+ for (const transport of this.transports) {
18
+ transport.close();
19
+ }
20
+ }
21
+ }
22
+ export {
23
+ LoggerHandlerList
24
+ };
25
+ //# sourceMappingURL=LoggerHandlerList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoggerHandlerList.js","sources":["../../../../../packages/logger/src/handlers/LoggerHandlerList.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types'\n\nexport class LoggerHandlerList implements LoggerHandler {\n\tconstructor(\n\t\tprivate readonly transports: LoggerHandler[] = [],\n\t) {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn Math.min(Number.MAX_SAFE_INTEGER, ...this.transports.map(it => it.getMinLevel()))\n\t}\n\n\tpublic addHandler(transport: LoggerHandler) {\n\t\tthis.transports.push(transport)\n\t}\n\n\thandle(logEntry: LogEntry) {\n\t\tfor (const transport of this.transports) {\n\t\t\ttransport.handle(logEntry)\n\t\t}\n\t}\n\n\tclose(): void {\n\t\tfor (const transport of this.transports) {\n\t\t\ttransport.close()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAA2C;AAAA,EACvD,YACkB,aAA8B,IAC9C;AADgB,SAAA,aAAA;AAAA,EAElB;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,IAAI,OAAO,kBAAkB,GAAG,KAAK,WAAW,IAAI,CAAA,OAAM,GAAG,YAAA,CAAa,CAAC;AAAA,EACxF;AAAA,EAEO,WAAW,WAA0B;AAC3C,SAAK,WAAW,KAAK,SAAS;AAAA,EAC/B;AAAA,EAEA,OAAO,UAAoB;AAC1B,eAAW,aAAa,KAAK,YAAY;AACxC,gBAAU,OAAO,QAAQ;AAAA,IAC1B;AAAA,EACD;AAAA,EAEA,QAAc;AACb,eAAW,aAAa,KAAK,YAAY;AACxC,gBAAU,MAAA;AAAA,IACX;AAAA,EACD;AACD;"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ class NullLoggerHandler {
4
+ close() {
5
+ }
6
+ getMinLevel() {
7
+ return Number.POSITIVE_INFINITY;
8
+ }
9
+ handle() {
10
+ }
11
+ }
12
+ exports.NullLoggerHandler = NullLoggerHandler;
13
+ //# sourceMappingURL=NullLoggerHandler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NullLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/NullLoggerHandler.ts"],"sourcesContent":["import { LoggerHandler } from '../types'\n\nexport class NullLoggerHandler implements LoggerHandler {\n\tclose(): void {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn Number.POSITIVE_INFINITY\n\t}\n\n\thandle(): void {\n\t}\n}\n"],"names":[],"mappings":";;AAEO,MAAM,kBAA2C;AAAA,EACvD,QAAc;AAAA,EACd;AAAA,EAEA,cAAsB;AACrB,WAAO,OAAO;AAAA,EACf;AAAA,EAEA,SAAe;AAAA,EACf;AACD;;"}
@@ -0,0 +1,13 @@
1
+ class NullLoggerHandler {
2
+ close() {
3
+ }
4
+ getMinLevel() {
5
+ return Number.POSITIVE_INFINITY;
6
+ }
7
+ handle() {
8
+ }
9
+ }
10
+ export {
11
+ NullLoggerHandler
12
+ };
13
+ //# sourceMappingURL=NullLoggerHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NullLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/NullLoggerHandler.ts"],"sourcesContent":["import { LoggerHandler } from '../types'\n\nexport class NullLoggerHandler implements LoggerHandler {\n\tclose(): void {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn Number.POSITIVE_INFINITY\n\t}\n\n\thandle(): void {\n\t}\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAA2C;AAAA,EACvD,QAAc;AAAA,EACd;AAAA,EAEA,cAAsB;AACrB,WAAO,OAAO;AAAA,EACf;AAAA,EAEA,SAAe;AAAA,EACf;AACD;"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const chalk = require("chalk");
4
+ const node_util = require("node:util");
5
+ const levels = require("../levels.cjs");
6
+ var __defProp = Object.defineProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
9
+ class PrettyPrintLoggerHandler {
10
+ constructor(stream, options = {}) {
11
+ this.stream = stream;
12
+ __publicField(this, "options");
13
+ this.options = {
14
+ logLevel: levels.LogLevels.debug,
15
+ formatters: {},
16
+ ...options
17
+ };
18
+ }
19
+ getMinLevel() {
20
+ return this.options.logLevel.value;
21
+ }
22
+ handle(entry) {
23
+ if (entry.level.value < this.options.logLevel.value) {
24
+ return;
25
+ }
26
+ const startLength = entry.isoTime.length + 7;
27
+ this.stream.write(`${this.formatTime(entry.isoTime)} ${this.formatLevel(entry.level)} `);
28
+ const indent = " ".repeat(startLength);
29
+ this.stream.write(`${entry.message.replaceAll(/\n/g, "\n" + indent)}
30
+ `);
31
+ const allAttributes = { ...entry.loggerAttributes, ...entry.ownAttributes };
32
+ for (const key in allAttributes) {
33
+ const value = allAttributes[key];
34
+ if (typeof key !== "string" || value === void 0) {
35
+ continue;
36
+ }
37
+ const formattedValue = node_util.inspect(value, {
38
+ depth: 5
39
+ }).replaceAll(/\n/g, "\n" + indent);
40
+ const formattedValue2 = this.options.formatters[key] ? this.options.formatters[key]({ value, key, formattedValue, chalk, attributes: allAttributes }) : formattedValue;
41
+ if (formattedValue2 === void 0) {
42
+ continue;
43
+ }
44
+ if (typeof formattedValue2 === "string") {
45
+ this.stream.write(indent + chalk.dim(`${key}: ${formattedValue2}
46
+ `));
47
+ } else {
48
+ this.stream.write(indent + formattedValue2.line + "\n");
49
+ }
50
+ }
51
+ if (entry.error) {
52
+ this.stream.write(node_util.inspect(entry.error).replaceAll(/^/gm, indent) + "\n");
53
+ }
54
+ }
55
+ formatTime(date) {
56
+ const result = date.match(/^([0-9-]+)T([0-9:]+)\.(\d+)Z$/);
57
+ if (!result) {
58
+ return date;
59
+ }
60
+ return chalk.dim(result[1] + "T") + result[2] + chalk.dim("." + result[3] + "Z");
61
+ }
62
+ formatLevel(level) {
63
+ const levelText = `${level.name}${" ".repeat(5 - level.name.length)}`;
64
+ let color = chalk;
65
+ if (level.value <= 10) {
66
+ color = color.dim;
67
+ } else if (level.value <= 20) ;
68
+ else if (level.value <= 30) {
69
+ color = color.yellowBright;
70
+ } else {
71
+ color = color.redBright;
72
+ }
73
+ return color(levelText);
74
+ }
75
+ close() {
76
+ }
77
+ }
78
+ exports.PrettyPrintLoggerHandler = PrettyPrintLoggerHandler;
79
+ //# sourceMappingURL=PrettyPrintLoggerHandler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrettyPrintLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/PrettyPrintLoggerHandler.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { inspect } from 'node:util'\nimport { LogEntry, LoggerAttributes, LoggerHandler, LogLevel } from '../types'\nimport { LogLevels } from '../levels'\n\nexport interface PrettyPrintLoggerHandlerOptions {\n\tlogLevel: LogLevel\n\tformatters: {\n\t\t[key: string]: (\n\t\t\targs: { value: any; formattedValue: string; key: string; chalk: typeof chalk; attributes: LoggerAttributes },\n\t\t) => undefined | string | { line: string }\n\t}\n}\n\nexport class PrettyPrintLoggerHandler implements LoggerHandler {\n\tprivate readonly options: PrettyPrintLoggerHandlerOptions\n\n\tconstructor(\n\t\tprivate readonly stream: NodeJS.WritableStream,\n\t\toptions: Partial<PrettyPrintLoggerHandlerOptions> = {},\n\t) {\n\t\tthis.options = {\n\t\t\tlogLevel: LogLevels.debug,\n\t\t\tformatters: {},\n\t\t\t...options,\n\t\t}\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn this.options.logLevel.value\n\t}\n\n\thandle(entry: LogEntry) {\n\t\tif (entry.level.value < this.options.logLevel.value) {\n\t\t\treturn\n\t\t}\n\t\tconst startLength = entry.isoTime.length + 7\n\n\t\tthis.stream.write(`${this.formatTime(entry.isoTime)} ${this.formatLevel(entry.level)} `)\n\n\t\tconst indent = ' '.repeat(startLength)\n\t\tthis.stream.write(`${entry.message.replaceAll(/\\n/g, '\\n' + indent)}\\n`)\n\t\tconst allAttributes = { ...entry.loggerAttributes, ...entry.ownAttributes }\n\t\tfor (const key in allAttributes) {\n\t\t\tconst value = allAttributes[key]\n\t\t\tif (typeof key !== 'string' || value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst formattedValue = inspect(value, {\n\t\t\t\tdepth: 5,\n\t\t\t}).replaceAll(/\\n/g, '\\n' + indent)\n\t\t\tconst formattedValue2 = this.options.formatters[key]\n\t\t\t\t? (this.options.formatters[key]({ value, key, formattedValue, chalk, attributes: allAttributes }))\n\t\t\t\t: formattedValue\n\t\t\tif (formattedValue2 === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (typeof formattedValue2 === 'string') {\n\t\t\t\tthis.stream.write(indent + chalk.dim(`${key}: ${formattedValue2}\\n`))\n\t\t\t} else {\n\t\t\t\tthis.stream.write(indent + formattedValue2.line + '\\n')\n\t\t\t}\n\t\t}\n\t\tif (entry.error) {\n\t\t\tthis.stream.write(inspect(entry.error).replaceAll(/^/gm, indent) + '\\n')\n\t\t}\n\t}\n\n\tprivate formatTime(date: string): string {\n\t\tconst result = date.match(/^([0-9-]+)T([0-9:]+)\\.(\\d+)Z$/)\n\t\tif (!result) {\n\t\t\treturn date\n\t\t}\n\t\treturn chalk.dim(result[1] + 'T') + result[2] + chalk.dim('.' + result[3] + 'Z')\n\t}\n\n\tprivate formatLevel(level: LogLevel): string {\n\t\tconst levelText = `${level.name}${' '.repeat(5 - level.name.length)}`\n\t\tlet color = chalk\n\t\tif (level.value <= 10) {\n\t\t\tcolor = color.dim\n\t\t} else if (level.value <= 20) {\n\t\t\t// nothing\n\t\t} else if (level.value <= 30) {\n\t\t\tcolor = color.yellowBright\n\t\t} else {\n\t\t\tcolor = color.redBright\n\t\t}\n\t\treturn color(levelText)\n\t}\n\n\tclose(): void {\n\t}\n}\n"],"names":["LogLevels","inspect"],"mappings":";;;;;;;;AAcO,MAAM,yBAAkD;AAAA,EAG9D,YACkB,QACjB,UAAoD,IACnD;AAFgB,SAAA,SAAA;AAHlB,kBAAA,MAAiB,SAAA;AAMhB,SAAK,UAAU;AAAA,MACd,UAAUA,OAAAA,UAAU;AAAA,MACpB,YAAY,CAAA;AAAA,MACZ,GAAG;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,QAAQ,SAAS;AAAA,EAC9B;AAAA,EAEA,OAAO,OAAiB;AACvB,QAAI,MAAM,MAAM,QAAQ,KAAK,QAAQ,SAAS,OAAO;AACpD;AAAA,IACD;AACA,UAAM,cAAc,MAAM,QAAQ,SAAS;AAE3C,SAAK,OAAO,MAAM,GAAG,KAAK,WAAW,MAAM,OAAO,CAAC,IAAI,KAAK,YAAY,MAAM,KAAK,CAAC,GAAG;AAEvF,UAAM,SAAS,IAAI,OAAO,WAAW;AACrC,SAAK,OAAO,MAAM,GAAG,MAAM,QAAQ,WAAW,OAAO,OAAO,MAAM,CAAC;AAAA,CAAI;AACvE,UAAM,gBAAgB,EAAE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