@contember/logger 2.1.0-rc.3 → 2.2.0-alpha.10
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/development/index.cjs +1 -0
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +2 -1
- package/dist/development/src/formatting.cjs.map +1 -1
- package/dist/development/src/formatting.js.map +1 -1
- package/dist/development/src/handlers/FingerCrossedLoggerHandler.cjs.map +1 -1
- package/dist/development/src/handlers/FingerCrossedLoggerHandler.js.map +1 -1
- package/dist/development/src/handlers/JsonStreamLoggerHandler.cjs.map +1 -1
- package/dist/development/src/handlers/JsonStreamLoggerHandler.js.map +1 -1
- package/dist/development/src/handlers/LoggerHandlerList.cjs.map +1 -1
- package/dist/development/src/handlers/LoggerHandlerList.js.map +1 -1
- package/dist/development/src/handlers/NullLoggerHandler.cjs.map +1 -1
- package/dist/development/src/handlers/NullLoggerHandler.js.map +1 -1
- package/dist/development/src/handlers/PrettyPrintLoggerHandler.cjs.map +1 -1
- package/dist/development/src/handlers/PrettyPrintLoggerHandler.js.map +1 -1
- package/dist/development/src/handlers/TestLoggerHandler.cjs.map +1 -1
- package/dist/development/src/handlers/TestLoggerHandler.js.map +1 -1
- package/dist/development/src/impl.cjs.map +1 -1
- package/dist/development/src/impl.js.map +1 -1
- package/dist/development/src/levels.cjs.map +1 -1
- package/dist/development/src/levels.js.map +1 -1
- package/dist/development/src/proxy.cjs +2 -0
- package/dist/development/src/proxy.cjs.map +1 -1
- package/dist/development/src/proxy.js +2 -0
- package/dist/development/src/proxy.js.map +1 -1
- package/dist/production/index.cjs +1 -0
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +2 -1
- package/dist/production/src/formatting.cjs.map +1 -1
- package/dist/production/src/formatting.js.map +1 -1
- package/dist/production/src/handlers/FingerCrossedLoggerHandler.cjs.map +1 -1
- package/dist/production/src/handlers/FingerCrossedLoggerHandler.js.map +1 -1
- package/dist/production/src/handlers/JsonStreamLoggerHandler.cjs.map +1 -1
- package/dist/production/src/handlers/JsonStreamLoggerHandler.js.map +1 -1
- package/dist/production/src/handlers/LoggerHandlerList.cjs.map +1 -1
- package/dist/production/src/handlers/LoggerHandlerList.js.map +1 -1
- package/dist/production/src/handlers/NullLoggerHandler.cjs.map +1 -1
- package/dist/production/src/handlers/NullLoggerHandler.js.map +1 -1
- package/dist/production/src/handlers/PrettyPrintLoggerHandler.cjs.map +1 -1
- package/dist/production/src/handlers/PrettyPrintLoggerHandler.js.map +1 -1
- package/dist/production/src/handlers/TestLoggerHandler.cjs.map +1 -1
- package/dist/production/src/handlers/TestLoggerHandler.js.map +1 -1
- package/dist/production/src/impl.cjs.map +1 -1
- package/dist/production/src/impl.js.map +1 -1
- package/dist/production/src/levels.cjs.map +1 -1
- package/dist/production/src/levels.js.map +1 -1
- package/dist/production/src/proxy.cjs +2 -0
- package/dist/production/src/proxy.cjs.map +1 -1
- package/dist/production/src/proxy.js +2 -0
- package/dist/production/src/proxy.js.map +1 -1
- package/dist/types/formatting.d.ts +1 -1
- package/dist/types/formatting.d.ts.map +1 -1
- package/dist/types/handlers/FingerCrossedLoggerHandler.d.ts +1 -1
- package/dist/types/handlers/FingerCrossedLoggerHandler.d.ts.map +1 -1
- package/dist/types/handlers/JsonStreamLoggerHandler.d.ts +1 -1
- package/dist/types/handlers/JsonStreamLoggerHandler.d.ts.map +1 -1
- package/dist/types/handlers/LoggerHandlerList.d.ts +1 -1
- package/dist/types/handlers/LoggerHandlerList.d.ts.map +1 -1
- package/dist/types/handlers/NullLoggerHandler.d.ts +1 -1
- package/dist/types/handlers/NullLoggerHandler.d.ts.map +1 -1
- package/dist/types/handlers/PrettyPrintLoggerHandler.d.ts +1 -1
- package/dist/types/handlers/PrettyPrintLoggerHandler.d.ts.map +1 -1
- package/dist/types/handlers/TestLoggerHandler.d.ts +1 -1
- package/dist/types/handlers/TestLoggerHandler.d.ts.map +1 -1
- package/dist/types/impl.d.ts +1 -1
- package/dist/types/impl.d.ts.map +1 -1
- package/dist/types/index.d.ts +10 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/levels.d.ts +1 -1
- package/dist/types/levels.d.ts.map +1 -1
- package/dist/types/proxy.d.ts +2 -1
- package/dist/types/proxy.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/formatting.ts +1 -1
- package/src/handlers/FingerCrossedLoggerHandler.ts +2 -2
- package/src/handlers/JsonStreamLoggerHandler.ts +2 -2
- package/src/handlers/LoggerHandlerList.ts +1 -1
- package/src/handlers/NullLoggerHandler.ts +1 -1
- package/src/handlers/PrettyPrintLoggerHandler.ts +2 -2
- package/src/handlers/TestLoggerHandler.ts +1 -1
- package/src/impl.ts +5 -5
- package/src/index.ts +10 -10
- package/src/levels.ts +1 -1
- package/src/proxy.ts +3 -1
- package/src/types.ts +1 -1
|
@@ -13,6 +13,7 @@ exports.createLogger = impl.createLogger;
|
|
|
13
13
|
exports.LogLevels = levels.LogLevels;
|
|
14
14
|
exports.getLogger = proxy.getLogger;
|
|
15
15
|
exports.logger = proxy.logger;
|
|
16
|
+
exports.tryGetLogger = proxy.tryGetLogger;
|
|
16
17
|
exports.withLogger = proxy.withLogger;
|
|
17
18
|
exports.FingerCrossedLoggerHandler = FingerCrossedLoggerHandler.FingerCrossedLoggerHandler;
|
|
18
19
|
exports.JsonStreamLoggerHandler = JsonStreamLoggerHandler.JsonStreamLoggerHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "./src/impl.js";
|
|
2
2
|
import { LogLevels } from "./src/levels.js";
|
|
3
|
-
import { getLogger, logger, withLogger } from "./src/proxy.js";
|
|
3
|
+
import { getLogger, logger, tryGetLogger, withLogger } from "./src/proxy.js";
|
|
4
4
|
import { FingerCrossedLoggerHandler } from "./src/handlers/FingerCrossedLoggerHandler.js";
|
|
5
5
|
import { JsonStreamLoggerHandler } from "./src/handlers/JsonStreamLoggerHandler.js";
|
|
6
6
|
import { PrettyPrintLoggerHandler } from "./src/handlers/PrettyPrintLoggerHandler.js";
|
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
createLogger,
|
|
19
19
|
getLogger,
|
|
20
20
|
logger,
|
|
21
|
+
tryGetLogger,
|
|
21
22
|
withLogger
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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,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,UAAUA,UAAAA,QAAQ,KAAK,CAAC;AAAA,EACrC;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"formatting.cjs","sources":["../../../../packages/logger/src/formatting.ts"],"sourcesContent":["import { LogEntry, LoggerAttributes } from './types.js'\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,c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rC;AACD;;;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"formatting.js","sources":["../../../../packages/logger/src/formatting.ts"],"sourcesContent":["import { LogEntry, LoggerAttributes } from './types.js'\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;"}
|
|
@@ -1 +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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e,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;;"}
|
|
1
|
+
{"version":3,"file":"FingerCrossedLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/FingerCrossedLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LoggerHandlerFactory, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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":["LogLevels"],"mappings":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rD,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;;"}
|
|
@@ -1 +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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ACD;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;"}
|
|
1
|
+
{"version":3,"file":"FingerCrossedLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/FingerCrossedLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LoggerHandlerFactory, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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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AACd,eAAW,SAAS,SAAS;AAC5B,UAAI,MAAM,MAAM,SAAS,SAAS,OAAO;AACxC,aAAK,MAAM,OAAO,KAAK;AAAA,MACxB;AAAA,IACD;AAAA,EACD;AACD;"}
|
|
@@ -1 +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;;"}
|
|
1
|
+
{"version":3,"file":"JsonStreamLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/JsonStreamLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"JsonStreamLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/JsonStreamLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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;"}
|
|
@@ -1 +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;;"}
|
|
1
|
+
{"version":3,"file":"LoggerHandlerList.cjs","sources":["../../../../../packages/logger/src/handlers/LoggerHandlerList.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types.js'\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;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"LoggerHandlerList.js","sources":["../../../../../packages/logger/src/handlers/LoggerHandlerList.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types.js'\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;"}
|
|
@@ -1 +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;;"}
|
|
1
|
+
{"version":3,"file":"NullLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/NullLoggerHandler.ts"],"sourcesContent":["import { LoggerHandler } from '../types.js'\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;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"NullLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/NullLoggerHandler.ts"],"sourcesContent":["import { LoggerHandler } from '../types.js'\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;"}
|
|
@@ -1 +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;AAF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O,IAAI;AAAA,MACvD;AAAA,IACD;AACA,QAAI,MAAM,OAAO;AAChB,WAAK,OAAO,MAAMA,UAAAA,QAAQ,MAAM,KAAK,EAAE,WAAW,OAAO,MAAM,IAAI,IAAI;AAAA,IACxE;AAAA,EACD;AAAA,EAEQ,WAAW,MAAsB;AACxC,UAAM,SAAS,KAAK,MAAM,+BAA+B;AACzD,QAAI,CAAC,QAAQ;AACZ,aAAO;AAAA,IACR;AACA,WAAO,MAAM,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,MAAM,IAAI,MAAM,OAAO,CAAC,IAAI,GAAG;AAAA,EAChF;AAAA,EAEQ,YAAY,OAAyB;AAC5C,UAAM,YAAY,GAAG,MAAM,IAAI,GAAG,IAAI,OAAO,IAAI,MAAM,KAAK,MAAM,CAAC;AACnE,QAAI,QAAQ;AACZ,QAAI,MAAM,SAAS,IAAI;AACtB,cAAQ,MAAM;AAAA,IACf,WAAW,MAAM,SAAS,GAAI;AAAA,aAEnB,MAAM,SAAS,IAAI;AAC7B,cAAQ,MAAM;AAAA,IACf,OAAO;AACN,cAAQ,MAAM;AAAA,IACf;AACA,WAAO,MAAM,SAAS;AAAA,EACvB;AAAA,EAEA,QAAc;AAAA,EACd;AACD;;"}
|
|
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.js'\nimport { LogLevels } from '../levels.js'\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,GAAG,MAAM,kBAAkB,GAAG,MAAM,cAAA;AAC5D,eAAW,OAAO,eAAe;AAChC,YAAM,QAAQ,cAAc,GAAG;AAC/B,UAAI,OAA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AO,MAAM,SAAS;AAAA,EACvB;AAAA,EAEA,QAAc;AAAA,EACd;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrettyPrintLoggerHandler.js","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":[],"mappings":";;;;;;AAcO,MAAM,yBAAkD;AAAA,EAG9D,YACkB,QACjB,UAAoD,IACnD;AAFgB,SAAA,SAAA;AAHlB,kBAAA,MAAiB,SAAA;AAMhB,SAAK,UAAU;AAAA,MACd,UAAU,UAAU;AAAA,MACpB,YAAY,CAAA;AAAA,MACZ,GAAG;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,cAAsB;AACrB,WAAO,KAAK,QAAQ,SAAS;AAAA,EAC9B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I,CAAC,QAAQ;AACZ,aAAO;AAAA,IACR;AACA,WAAO,MAAM,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,MAAM,IAAI,MAAM,OAAO,CAAC,IAAI,GAAG;AAAA,EAChF;AAAA,EAEQ,YAAY,OAAyB;AAC5C,UAAM,YAAY,GAAG,MAAM,IAAI,GAAG,IAAI,OAAO,IAAI,MAAM,KAAK,MAAM,CAAC;AACnE,QAAI,QAAQ;AACZ,QAAI,MAAM,SAAS,IAAI;AACtB,cAAQ,MAAM;AAAA,IACf,WAAW,MAAM,SAAS,GAAI;AAAA,aAEnB,MAAM,SAAS,IAAI;AAC7B,cAAQ,MAAM;AAAA,IACf,OAAO;AACN,cAAQ,MAAM;AAAA,IACf;AACA,WAAO,MAAM,SAAS;AAAA,EACvB;AAAA,EAEA,QAAc;AAAA,EACd;AACD;"}
|
|
1
|
+
{"version":3,"file":"PrettyPrintLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/PrettyPrintLoggerHandler.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { inspect } from 'node:util'\nimport { LogEntry, LoggerAttributes, LoggerHandler, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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":[],"mappings":";;;;;;AAcO,MAAM,yBAAkD;AAAA,EAG9D,YACkB,QACjB,UAAoD,IACnD;AAFgB,SAAA,SAAA;AAHlB,kBAAA,MAAiB,SAAA;AAMhB,SAAK,UAAU;AAAA,MACd,UAAU,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,GAAG,MAAM,kBAAkB,GAAG,MAAM,cAAA;AAC5D,eAAW,OAAO,eAAe;AAChC,YAAM,QAAQ,cAAc,GAAG;AAC/B,UAAI,OAAO,QAAQ,YAAY,UAAU,QAAW;AACnD;AAAA,MACD;AACA,YAAM,iBAAiB,QAAQ,OAAO;AAAA,QACrC,OAAO;AAAA,MAAA,CACP,EAAE,WAAW,OAAO,OAAO,MAAM;AAClC,YAAM,kBAAkB,KAAK,QAAQ,WAAW,GAAG,IAC/C,KAAK,QAAQ,WAAW,GAAG,EAAE,EAAE,OAAO,KAAK,gBAAgB,OAAO,YAAY,cAAA,CAAe,IAC9F;AACH,UAAI,oBAAoB,QAAW;AAClC;AAAA,MACD;AACA,UAAI,OAAO,oBAAoB,UAAU;AACxC,aAAK,OAAO,MAAM,SAAS,MAAM,IAAI,GAAG,GAAG,KAAK,eAAe;AAAA,CAAI,CAAC;AAAA,MACrE,OAAO;AACN,aAAK,OAAO,MAAM,SAAS,gBAAgB,OAAO,IAAI;AAAA,MACvD;AAAA,IACD;AACA,QAAI,MAAM,OAAO;AAChB,WAAK,OAAO,MAAM,QAAQ,MAAM,KAAK,EAAE,WAAW,OAAO,MAAM,IAAI,IAAI;AAAA,IACxE;AAAA,EACD;AAAA,EAEQ,WAAW,MAAsB;AACxC,UAAM,SAAS,KAAK,MAAM,+BAA+B;AACzD,QAAI,CAAC,QAAQ;AACZ,aAAO;AAAA,IACR;AACA,WAAO,MAAM,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,MAAM,IAAI,MAAM,OAAO,CAAC,IAAI,GAAG;AAAA,EAChF;AAAA,EAEQ,YAAY,OAAyB;AAC5C,UAAM,YAAY,GAAG,MAAM,IAAI,GAAG,IAAI,OAAO,IAAI,MAAM,KAAK,MAAM,CAAC;AACnE,QAAI,QAAQ;AACZ,QAAI,MAAM,SAAS,IAAI;AACtB,cAAQ,MAAM;AAAA,IACf,WAAW,MAAM,SAAS,GAAI;AAAA,aAEnB,MAAM,SAAS,IAAI;AAC7B,cAAQ,MAAM;AAAA,IACf,OAAO;AACN,cAAQ,MAAM;AAAA,IACf;AACA,WAAO,MAAM,SAAS;AAAA,EACvB;AAAA,EAEA,QAAc;AAAA,EACd;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/TestLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types'\n\nexport class TestLoggerHandler implements LoggerHandler {\n\tpublic readonly messages: LogEntry[] = []\n\n\tconstructor(\n\t\tprivate print = false,\n\t) {\n\t}\n\n\tclose(): void {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn 0\n\t}\n\n\thandle(logEntry: LogEntry): void {\n\t\tthis.messages.push(logEntry)\n\t\tif (this.print) {\n\t\t\tconsole.error(logEntry.message)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAEO,MAAM,kBAA2C;AAAA,EAGvD,YACS,QAAQ,OACf;AADO,SAAA,QAAA;AAHT,kBAAA,MAAgB,YAAuB,EAAC;AAAA,EAKxC;AAAA,EAEA,QAAc;AAAA,EACd;AAAA,EAEA,cAAsB;AACrB,WAAO;AAAA,EACR;AAAA,EAEA,OAAO,UAA0B;AAChC,SAAK,SAAS,KAAK,QAAQ;AAC3B,QAAI,KAAK,OAAO;AACf,cAAQ,MAAM,SAAS,OAAO;AAAA,IAC/B;AAAA,EACD;AACD;;"}
|
|
1
|
+
{"version":3,"file":"TestLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/TestLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types.js'\n\nexport class TestLoggerHandler implements LoggerHandler {\n\tpublic readonly messages: LogEntry[] = []\n\n\tconstructor(\n\t\tprivate print = false,\n\t) {\n\t}\n\n\tclose(): void {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn 0\n\t}\n\n\thandle(logEntry: LogEntry): void {\n\t\tthis.messages.push(logEntry)\n\t\tif (this.print) {\n\t\t\tconsole.error(logEntry.message)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAEO,MAAM,kBAA2C;AAAA,EAGvD,YACS,QAAQ,OACf;AADO,SAAA,QAAA;AAHT,kBAAA,MAAgB,YAAuB,EAAC;AAAA,EAKxC;AAAA,EAEA,QAAc;AAAA,EACd;AAAA,EAEA,cAAsB;AACrB,WAAO;AAAA,EACR;AAAA,EAEA,OAAO,UAA0B;AAChC,SAAK,SAAS,KAAK,QAAQ;AAC3B,QAAI,KAAK,OAAO;AACf,cAAQ,MAAM,SAAS,OAAO;AAAA,IAC/B;AAAA,EACD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/TestLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types'\n\nexport class TestLoggerHandler implements LoggerHandler {\n\tpublic readonly messages: LogEntry[] = []\n\n\tconstructor(\n\t\tprivate print = false,\n\t) {\n\t}\n\n\tclose(): void {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn 0\n\t}\n\n\thandle(logEntry: LogEntry): void {\n\t\tthis.messages.push(logEntry)\n\t\tif (this.print) {\n\t\t\tconsole.error(logEntry.message)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,kBAA2C;AAAA,EAGvD,YACS,QAAQ,OACf;AADO,SAAA,QAAA;AAHT,kBAAA,MAAgB,YAAuB,EAAC;AAAA,EAKxC;AAAA,EAEA,QAAc;AAAA,EACd;AAAA,EAEA,cAAsB;AACrB,WAAO;AAAA,EACR;AAAA,EAEA,OAAO,UAA0B;AAChC,SAAK,SAAS,KAAK,QAAQ;AAC3B,QAAI,KAAK,OAAO;AACf,cAAQ,MAAM,SAAS,OAAO;AAAA,IAC/B;AAAA,EACD;AACD;"}
|
|
1
|
+
{"version":3,"file":"TestLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/TestLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types.js'\n\nexport class TestLoggerHandler implements LoggerHandler {\n\tpublic readonly messages: LogEntry[] = []\n\n\tconstructor(\n\t\tprivate print = false,\n\t) {\n\t}\n\n\tclose(): void {\n\t}\n\n\tgetMinLevel(): number {\n\t\treturn 0\n\t}\n\n\thandle(logEntry: LogEntry): void {\n\t\tthis.messages.push(logEntry)\n\t\tif (this.print) {\n\t\t\tconsole.error(logEntry.message)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,kBAA2C;AAAA,EAGvD,YACS,QAAQ,OACf;AADO,SAAA,QAAA;AAHT,kBAAA,MAAgB,YAAuB,EAAC;AAAA,EAKxC;AAAA,EAEA,QAAc;AAAA,EACd;AAAA,EAEA,cAAsB;AACrB,WAAO;AAAA,EACR;AAAA,EAEA,OAAO,UAA0B;AAChC,SAAK,SAAS,KAAK,QAAQ;AAC3B,QAAI,KAAK,OAAO;AACf,cAAQ,MAAM,SAAS,OAAO;AAAA,IAC/B;AAAA,EACD;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl.cjs","sources":["../../../../packages/logger/src/impl.ts"],"sourcesContent":["import {\n\tLogEntry,\n\tLogEntryFormatted,\n\tLogger,\n\tLoggerAttributes,\n\tLoggerChildOptions,\n\tLoggerHandler,\n\tLoggerOptions,\n\tLogLevel,\n\tLogLevelName,\n} from './types'\nimport { LogLevels } from './levels'\nimport { formatLogEntryAttributes, formatLoggerAttributes, FormattedAttributes, stringify } from './formatting'\nimport { LoggerHandlerList } from './handlers/LoggerHandlerList'\nimport { withLogger } from './proxy'\n\nexport const createLogger = (\n\thandler: LoggerHandler,\n\tattributes: LoggerAttributes = {},\n\toptions: LoggerOptions = {},\n): Logger => {\n\treturn LoggerImpl.create(handler, attributes, options)\n}\n\nexport class LoggerImpl implements Logger {\n\tpublic readonly attributes: LoggerAttributes\n\tprivate formattedAttributes: FormattedAttributes | undefined\n\tprivate minLevelValue: number\n\tprivate handlerList: LoggerHandlerList | undefined\n\n\tprivate constructor(\n\t\tprivate handler: LoggerHandler,\n\t\tprivate readonly ownAttributes: LoggerAttributes,\n\t\tprivate readonly depth: number,\n\t\tprivate readonly parent: LoggerImpl | undefined,\n\t\tprivate readonly options: LoggerOptions,\n\t) {\n\t\tthis.attributes = { ...parent?.attributes, ...ownAttributes }\n\t\tthis.minLevelValue = handler.getMinLevel()\n\t}\n\n\tpublic static create(\n\t\thandler: LoggerHandler,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: LoggerOptions = {},\n\t) {\n\t\treturn new LoggerImpl(handler, attributes, 0, undefined, options)\n\t}\n\n\tpublic crit(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.crit.value && this.doLog(LogLevels.crit, messageOrError, attributes)\n\t}\n\n\tpublic error(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.error.value && this.doLog(LogLevels.error, messageOrError, attributes)\n\t}\n\n\tpublic warn(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.warn.value && this.doLog(LogLevels.warn, messageOrError, attributes)\n\t}\n\n\tpublic info(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.info.value && this.doLog(LogLevels.info, messageOrError, attributes)\n\t}\n\n\tpublic debug(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.debug.value && this.doLog(LogLevels.debug, messageOrError, attributes)\n\t}\n\n\tpublic log(levelName: LogLevelName, messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tconst level = LogLevels[levelName]\n\t\tthis.minLevelValue <= level.value && this.doLog(level, messageOrError, attributes)\n\t}\n\n\tpublic child(attributes: LoggerAttributes = {}, options: Partial<LoggerChildOptions> = {}): Logger {\n\t\tconst newHandler = options.handler ? options.handler(this.handler, this.options) : this.handler\n\t\treturn new LoggerImpl(newHandler, attributes, this.depth + 1, this, { ...this.options, ...options })\n\t}\n\n\tpublic async scope<T>(\n\t\tcb: (logger: Logger) => Promise<T> | T,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: Partial<LoggerChildOptions> = {},\n\t): Promise<T> {\n\t\tconst logger = this.child(attributes, options)\n\t\ttry {\n\t\t\treturn await withLogger(logger, () => cb(logger))\n\t\t} finally {\n\t\t\tlogger.close()\n\t\t}\n\t}\n\n\tprivate doLog(level: LogLevel, errorOrMessage: unknown, { error: errorAttr, message: messageAttr, ...attributes }: LoggerAttributes = {}) {\n\t\tconst error: unknown | undefined = typeof errorOrMessage !== 'string' ? errorOrMessage : errorAttr\n\t\tconst errorMessage = typeof error === 'object' && error !== null && typeof (error as any).message === 'string'\n\t\t\t? (error as any).message\n\t\t\t: undefined\n\n\t\tconst passedMessage = typeof errorOrMessage === 'string'\n\t\t\t? errorOrMessage\n\t\t\t: (typeof messageAttr === 'string')\n\t\t\t? messageAttr\n\t\t\t: undefined\n\n\t\tconst message = errorMessage && passedMessage ? `${passedMessage}: ${errorMessage}` : (passedMessage ?? errorMessage ?? 'undefined message')\n\n\t\tconst now = new Date()\n\t\tlet formatted: LogEntryFormatted\n\t\tconst entry: LogEntry = {\n\t\t\tlevel,\n\t\t\terror,\n\t\t\tmessage,\n\t\t\townAttributes: attributes,\n\t\t\ttime: now,\n\t\t\tisoTime: now.toISOString(),\n\t\t\tdepth: this.depth,\n\t\t\tloggerAttributes: this.attributes,\n\t\t\tformat: () => {\n\t\t\t\treturn formatted ??= {\n\t\t\t\t\tattributes: formatLogEntryAttributes(this.getFormattedAttributes(), entry),\n\t\t\t\t\tmessage: stringify(entry.message),\n\t\t\t\t\terror: entry.error ? `, \"error\": ${stringify(entry.error)}` : '',\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t\tthis.handler.handle(entry)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tif (!this.handlerList) {\n\t\t\tthis.handlerList = new LoggerHandlerList([this.handler])\n\t\t\tthis.handler = this.handlerList\n\t\t}\n\t\tthis.handlerList.addHandler(handler)\n\t\tthis.minLevelValue = Math.min(this.minLevelValue, handler.getMinLevel())\n\t}\n\n\tclose(): void {\n\t\tthis.handler.close()\n\t}\n\n\tprivate getFormattedAttributes(): FormattedAttributes {\n\t\tif (this.formattedAttributes) {\n\t\t\treturn this.formattedAttributes\n\t\t}\n\t\tconst parentAttributes = this.parent?.getFormattedAttributes()\n\t\tthis.formattedAttributes = formatLoggerAttributes(parentAttributes, this.ownAttributes)\n\t\treturn this.formattedAttributes\n\t}\n}\n"],"names":["LogLevels","withLogger","formatLogEntryAttributes","stringify","LoggerHandlerList","formatLoggerAttributes"],"mappings":";;;;;;;;;AAgBO,MAAM,eAAe,CAC3B,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,MACb;AACZ,SAAO,WAAW,OAAO,SAAS,YAAY,OAAO;AACtD;AAEO,MAAM,WAA6B;AAAA,EAMjC,YACC,SACS,eACA,OACA,QACA,SAChB;AALO,SAAA,UAAA;AACS,SAAA,gBAAA;AACA,SAAA,QAAA;AACA,SAAA,SAAA;AACA,SAAA,UAAA;AAVlB,kBAAA,MAAgB,YAAA;AAChB,kBAAA,MAAQ,qBAAA;AACR,kBAAA,MAAQ,eAAA;AACR,kBAAA,MAAQ,aAAA;AASP,SAAK,aAAa,EAAE,GAAG,QAAQ,YAAY,GAAG,cAAA;AAC9C,SAAK,gBAAgB,QAAQ,YAAA;AAAA,EAC9B;AAAA,EAEA,OAAc,OACb,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,GACxB;AACD,WAAO,IAAI,WAAW,SAAS,YAAY,GAAG,QAAW,OAAO;AAAA,EACjE;AAAA,EAEO,KAAK,gBAAyB,YAA+B;AACnE,SAAK,iBAAiBA,iBAAU,KAAK,SAAS,KAAK,MAAMA,OAAAA,UAAU,MAAM,gBAAgB,UAAU;AAAA,EACpG;AAAA,EAEO,MAAM,gBAAyB,YAA+B;AACpE,SAAK,iBAAiBA,iBAAU,MAAM,SAAS,KAAK,MAAMA,OAAAA,UAAU,OAAO,gBAAgB,UAAU;AAAA,EACtG;AAAA,EAEO,KAAK,gBAAyB,YAA+B;AACnE,SAAK,iBAAiBA,iBAAU,KAAK,SAAS,KAAK,MAAMA,OAAAA,UAAU,MAAM,gBAAgB,UAAU;AAAA,EACpG;AAAA,EAEO,KAAK,gBAAyB,YAA+B;AACnE,SAAK,iBAAiBA,iBAAU,KAAK,SAAS,KAAK,MAAMA,OAAAA,UAAU,MAAM,gBAA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;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,MACf,MAAM;AAAA,MACN,SAAS,IAAI,YAAA;AAAA,MACb,OAAO,KAAK;AAAA,MACZ,kBAAkB,KAAK;AAAA,MACvB,QAAQ,MAAM;AACb,eAAO,cAAA,YAAc;AAAA,UACpB,YAAYC,WAAAA,yBAAyB,KAAK,uBAAA,GAA0B,KAAK;AAAA,UACzE,SAASC,WAAAA,UAAU,MAAM,OAAO;AAAA,UAChC,OAAO,MAAM,QAAQ,cAAcA,WAAAA,UAAU,MAAM,KAAK,CAAC,KAAK;AAAA,QAAA;AAAA,MAEhE;AAAA,IAAA;AAED,SAAK,QAAQ,OAAO,KAAK;AAAA,EAC1B;AAAA,EAEA,WAAW,SAA8B;AACxC,QAAI,CAAC,KAAK,aAAa;AACtB,WAAK,cAAc,IAAIC,kBAAAA,kBAAkB,CAAC,KAAK,OAAO,CAAC;AACvD,WAAK,UAAU,KAAK;AAAA,IACrB;AACA,SAAK,YAAY,WAAW,OAAO;AACnC,SAAK,gBAAgB,KAAK,IAAI,KAAK,eAAe,QAAQ,aAAa;AAAA,EACxE;AAAA,EAEA,QAAc;AACb,SAAK,QAAQ,MAAA;AAAA,EACd;AAAA,EAEQ,yBAA8C;AACrD,QAAI,KAAK,qBAAqB;AAC7B,aAAO,KAAK;AAAA,IACb;AACA,UAAM,mBAAmB,KAAK,QAAQ,uBAAA;AACtC,SAAK,sBAAsBC,WAAAA,uBAAuB,kBAAkB,KAAK,aAAa;AACtF,WAAO,KAAK;AAAA,EACb;AACD;;;"}
|
|
1
|
+
{"version":3,"file":"impl.cjs","sources":["../../../../packages/logger/src/impl.ts"],"sourcesContent":["import {\n\tLogEntry,\n\tLogEntryFormatted,\n\tLogger,\n\tLoggerAttributes,\n\tLoggerChildOptions,\n\tLoggerHandler,\n\tLoggerOptions,\n\tLogLevel,\n\tLogLevelName,\n} from './types.js'\nimport { LogLevels } from './levels.js'\nimport { formatLogEntryAttributes, formatLoggerAttributes, FormattedAttributes, stringify } from './formatting.js'\nimport { LoggerHandlerList } from './handlers/LoggerHandlerList.js'\nimport { withLogger } from './proxy.js'\n\nexport const createLogger = (\n\thandler: LoggerHandler,\n\tattributes: LoggerAttributes = {},\n\toptions: LoggerOptions = {},\n): Logger => {\n\treturn LoggerImpl.create(handler, attributes, options)\n}\n\nexport class LoggerImpl implements Logger {\n\tpublic readonly attributes: LoggerAttributes\n\tprivate formattedAttributes: FormattedAttributes | undefined\n\tprivate minLevelValue: number\n\tprivate handlerList: LoggerHandlerList | undefined\n\n\tprivate constructor(\n\t\tprivate handler: LoggerHandler,\n\t\tprivate readonly ownAttributes: LoggerAttributes,\n\t\tprivate readonly depth: number,\n\t\tprivate readonly parent: LoggerImpl | undefined,\n\t\tprivate readonly options: LoggerOptions,\n\t) {\n\t\tthis.attributes = { ...parent?.attributes, ...ownAttributes }\n\t\tthis.minLevelValue = handler.getMinLevel()\n\t}\n\n\tpublic static create(\n\t\thandler: LoggerHandler,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: LoggerOptions = {},\n\t) {\n\t\treturn new LoggerImpl(handler, attributes, 0, undefined, options)\n\t}\n\n\tpublic crit(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.crit.value && this.doLog(LogLevels.crit, messageOrError, attributes)\n\t}\n\n\tpublic error(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.error.value && this.doLog(LogLevels.error, messageOrError, attributes)\n\t}\n\n\tpublic warn(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.warn.value && this.doLog(LogLevels.warn, messageOrError, attributes)\n\t}\n\n\tpublic info(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.info.value && this.doLog(LogLevels.info, messageOrError, attributes)\n\t}\n\n\tpublic debug(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.debug.value && this.doLog(LogLevels.debug, messageOrError, attributes)\n\t}\n\n\tpublic log(levelName: LogLevelName, messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tconst level = LogLevels[levelName]\n\t\tthis.minLevelValue <= level.value && this.doLog(level, messageOrError, attributes)\n\t}\n\n\tpublic child(attributes: LoggerAttributes = {}, options: Partial<LoggerChildOptions> = {}): Logger {\n\t\tconst newHandler = options.handler ? options.handler(this.handler, this.options) : this.handler\n\t\treturn new LoggerImpl(newHandler, attributes, this.depth + 1, this, { ...this.options, ...options })\n\t}\n\n\tpublic async scope<T>(\n\t\tcb: (logger: Logger) => Promise<T> | T,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: Partial<LoggerChildOptions> = {},\n\t): Promise<T> {\n\t\tconst logger = this.child(attributes, options)\n\t\ttry {\n\t\t\treturn await withLogger(logger, () => cb(logger))\n\t\t} finally {\n\t\t\tlogger.close()\n\t\t}\n\t}\n\n\tprivate doLog(level: LogLevel, errorOrMessage: unknown, { error: errorAttr, message: messageAttr, ...attributes }: LoggerAttributes = {}) {\n\t\tconst error: unknown | undefined = typeof errorOrMessage !== 'string' ? errorOrMessage : errorAttr\n\t\tconst errorMessage = typeof error === 'object' && error !== null && typeof (error as any).message === 'string'\n\t\t\t? (error as any).message\n\t\t\t: undefined\n\n\t\tconst passedMessage = typeof errorOrMessage === 'string'\n\t\t\t? errorOrMessage\n\t\t\t: (typeof messageAttr === 'string')\n\t\t\t? messageAttr\n\t\t\t: undefined\n\n\t\tconst message = errorMessage && passedMessage ? `${passedMessage}: ${errorMessage}` : (passedMessage ?? errorMessage ?? 'undefined message')\n\n\t\tconst now = new Date()\n\t\tlet formatted: LogEntryFormatted\n\t\tconst entry: LogEntry = {\n\t\t\tlevel,\n\t\t\terror,\n\t\t\tmessage,\n\t\t\townAttributes: attributes,\n\t\t\ttime: now,\n\t\t\tisoTime: now.toISOString(),\n\t\t\tdepth: this.depth,\n\t\t\tloggerAttributes: this.attributes,\n\t\t\tformat: () => {\n\t\t\t\treturn formatted ??= {\n\t\t\t\t\tattributes: formatLogEntryAttributes(this.getFormattedAttributes(), entry),\n\t\t\t\t\tmessage: stringify(entry.message),\n\t\t\t\t\terror: entry.error ? `, \"error\": ${stringify(entry.error)}` : '',\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t\tthis.handler.handle(entry)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tif (!this.handlerList) {\n\t\t\tthis.handlerList = new LoggerHandlerList([this.handler])\n\t\t\tthis.handler = this.handlerList\n\t\t}\n\t\tthis.handlerList.addHandler(handler)\n\t\tthis.minLevelValue = Math.min(this.minLevelValue, handler.getMinLevel())\n\t}\n\n\tclose(): void {\n\t\tthis.handler.close()\n\t}\n\n\tprivate getFormattedAttributes(): FormattedAttributes {\n\t\tif (this.formattedAttributes) {\n\t\t\treturn this.formattedAttributes\n\t\t}\n\t\tconst parentAttributes = this.parent?.getFormattedAttributes()\n\t\tthis.formattedAttributes = formatLoggerAttributes(parentAttributes, this.ownAttributes)\n\t\treturn this.formattedAttributes\n\t}\n}\n"],"names":["LogLevels","withLogger","formatLogEntryAttributes","stringify","LoggerHandlerList","formatLoggerAttributes"],"mappings":";;;;;;;;;AAgBO,MAAM,eAAe,CAC3B,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,MACb;AACZ,SAAO,WAAW,OAAO,SAAS,YAAY,OAAO;AACtD;AAEO,MAAM,WAA6B;AAAA,EAMjC,YACC,SACS,eACA,OACA,QACA,SAChB;AALO,SAAA,UAAA;AACS,SAAA,gBAAA;AACA,SAAA,QAAA;AACA,SAAA,SAAA;AACA,SAAA,UAAA;AAVlB,kBAAA,MAAgB,YAAA;AAChB,kBAAA,MAAQ,qBAAA;AACR,kBAAA,MAAQ,eAAA;AACR,kBAAA,MAAQ,aAAA;AASP,SAAK,aAAa,EAAE,GAAG,QAAQ,YAAY,GAAG,cAAA;AAC9C,SAAK,gBAAgB,QAAQ,YAAA;A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C;AACvD,WAAK,UAAU,KAAK;AAAA,IACrB;AACA,SAAK,YAAY,WAAW,OAAO;AACnC,SAAK,gBAAgB,KAAK,IAAI,KAAK,eAAe,QAAQ,aAAa;AAAA,EACxE;AAAA,EAEA,QAAc;AACb,SAAK,QAAQ,MAAA;AAAA,EACd;AAAA,EAEQ,yBAA8C;AACrD,QAAI,KAAK,qBAAqB;AAC7B,aAAO,KAAK;AAAA,IACb;AACA,UAAM,mBAAmB,KAAK,QAAQ,uBAAA;AACtC,SAAK,sBAAsBC,WAAAA,uBAAuB,kBAAkB,KAAK,aAAa;AACtF,WAAO,KAAK;AAAA,EACb;AACD;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"impl.js","sources":["../../../../packages/logger/src/impl.ts"],"sourcesContent":["import {\n\tLogEntry,\n\tLogEntryFormatted,\n\tLogger,\n\tLoggerAttributes,\n\tLoggerChildOptions,\n\tLoggerHandler,\n\tLoggerOptions,\n\tLogLevel,\n\tLogLevelName,\n} from './types'\nimport { LogLevels } from './levels'\nimport { formatLogEntryAttributes, formatLoggerAttributes, FormattedAttributes, stringify } from './formatting'\nimport { LoggerHandlerList } from './handlers/LoggerHandlerList'\nimport { withLogger } from './proxy'\n\nexport const createLogger = (\n\thandler: LoggerHandler,\n\tattributes: LoggerAttributes = {},\n\toptions: LoggerOptions = {},\n): Logger => {\n\treturn LoggerImpl.create(handler, attributes, options)\n}\n\nexport class LoggerImpl implements Logger {\n\tpublic readonly attributes: LoggerAttributes\n\tprivate formattedAttributes: FormattedAttributes | undefined\n\tprivate minLevelValue: number\n\tprivate handlerList: LoggerHandlerList | undefined\n\n\tprivate constructor(\n\t\tprivate handler: LoggerHandler,\n\t\tprivate readonly ownAttributes: LoggerAttributes,\n\t\tprivate readonly depth: number,\n\t\tprivate readonly parent: LoggerImpl | undefined,\n\t\tprivate readonly options: LoggerOptions,\n\t) {\n\t\tthis.attributes = { ...parent?.attributes, ...ownAttributes }\n\t\tthis.minLevelValue = handler.getMinLevel()\n\t}\n\n\tpublic static create(\n\t\thandler: LoggerHandler,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: LoggerOptions = {},\n\t) {\n\t\treturn new LoggerImpl(handler, attributes, 0, undefined, options)\n\t}\n\n\tpublic crit(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.crit.value && this.doLog(LogLevels.crit, messageOrError, attributes)\n\t}\n\n\tpublic error(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.error.value && this.doLog(LogLevels.error, messageOrError, attributes)\n\t}\n\n\tpublic warn(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.warn.value && this.doLog(LogLevels.warn, messageOrError, attributes)\n\t}\n\n\tpublic info(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.info.value && this.doLog(LogLevels.info, messageOrError, attributes)\n\t}\n\n\tpublic debug(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.debug.value && this.doLog(LogLevels.debug, messageOrError, attributes)\n\t}\n\n\tpublic log(levelName: LogLevelName, messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tconst level = LogLevels[levelName]\n\t\tthis.minLevelValue <= level.value && this.doLog(level, messageOrError, attributes)\n\t}\n\n\tpublic child(attributes: LoggerAttributes = {}, options: Partial<LoggerChildOptions> = {}): Logger {\n\t\tconst newHandler = options.handler ? options.handler(this.handler, this.options) : this.handler\n\t\treturn new LoggerImpl(newHandler, attributes, this.depth + 1, this, { ...this.options, ...options })\n\t}\n\n\tpublic async scope<T>(\n\t\tcb: (logger: Logger) => Promise<T> | T,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: Partial<LoggerChildOptions> = {},\n\t): Promise<T> {\n\t\tconst logger = this.child(attributes, options)\n\t\ttry {\n\t\t\treturn await withLogger(logger, () => cb(logger))\n\t\t} finally {\n\t\t\tlogger.close()\n\t\t}\n\t}\n\n\tprivate doLog(level: LogLevel, errorOrMessage: unknown, { error: errorAttr, message: messageAttr, ...attributes }: LoggerAttributes = {}) {\n\t\tconst error: unknown | undefined = typeof errorOrMessage !== 'string' ? errorOrMessage : errorAttr\n\t\tconst errorMessage = typeof error === 'object' && error !== null && typeof (error as any).message === 'string'\n\t\t\t? (error as any).message\n\t\t\t: undefined\n\n\t\tconst passedMessage = typeof errorOrMessage === 'string'\n\t\t\t? errorOrMessage\n\t\t\t: (typeof messageAttr === 'string')\n\t\t\t? messageAttr\n\t\t\t: undefined\n\n\t\tconst message = errorMessage && passedMessage ? `${passedMessage}: ${errorMessage}` : (passedMessage ?? errorMessage ?? 'undefined message')\n\n\t\tconst now = new Date()\n\t\tlet formatted: LogEntryFormatted\n\t\tconst entry: LogEntry = {\n\t\t\tlevel,\n\t\t\terror,\n\t\t\tmessage,\n\t\t\townAttributes: attributes,\n\t\t\ttime: now,\n\t\t\tisoTime: now.toISOString(),\n\t\t\tdepth: this.depth,\n\t\t\tloggerAttributes: this.attributes,\n\t\t\tformat: () => {\n\t\t\t\treturn formatted ??= {\n\t\t\t\t\tattributes: formatLogEntryAttributes(this.getFormattedAttributes(), entry),\n\t\t\t\t\tmessage: stringify(entry.message),\n\t\t\t\t\terror: entry.error ? `, \"error\": ${stringify(entry.error)}` : '',\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t\tthis.handler.handle(entry)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tif (!this.handlerList) {\n\t\t\tthis.handlerList = new LoggerHandlerList([this.handler])\n\t\t\tthis.handler = this.handlerList\n\t\t}\n\t\tthis.handlerList.addHandler(handler)\n\t\tthis.minLevelValue = Math.min(this.minLevelValue, handler.getMinLevel())\n\t}\n\n\tclose(): void {\n\t\tthis.handler.close()\n\t}\n\n\tprivate getFormattedAttributes(): FormattedAttributes {\n\t\tif (this.formattedAttributes) {\n\t\t\treturn this.formattedAttributes\n\t\t}\n\t\tconst parentAttributes = this.parent?.getFormattedAttributes()\n\t\tthis.formattedAttributes = formatLoggerAttributes(parentAttributes, this.ownAttributes)\n\t\treturn this.formattedAttributes\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAgBO,MAAM,eAAe,CAC3B,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,MACb;AACZ,SAAO,WAAW,OAAO,SAAS,YAAY,OAAO;AACtD;AAEO,MAAM,WAA6B;AAAA,EAMjC,YACC,SACS,eACA,OACA,QACA,SAChB;AALO,SAAA,UAAA;AACS,SAAA,gBAAA;AACA,SAAA,QAAA;AACA,SAAA,SAAA;AACA,SAAA,UAAA;AAVlB,kBAAA,MAAgB,YAAA;AAChB,kBAAA,MAAQ,qBAAA;AACR,kBAAA,MAAQ,eAAA;AACR,kBAAA,MAAQ,aAAA;AASP,SAAK,aAAa,EAAE,GAAG,QAAQ,YAAY,GAAG,cAAA;AAC9C,SAAK,gBAAgB,QAAQ,YAAA;AAAA,EAC9B;AAAA,EAEA,OAAc,OACb,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,GACxB;AACD,WAAO,IAAI,WAAW,SAAS,YAAY,GAAG,QAAW,OAAO;AAAA,EACjE;AAAA,EAEO,KAAK,gBAAyB,YAA+B;AACnE,SAAK,iBAAiB,UAAU,KAAK,SAAS,KAAK,MAAM,UAAU,MAAM,gBAAgB,UAAU;AAAA,EACpG;AAAA,EAEO,MAAM,gBAAyB,YAA+B;AACpE,SAAK,iBAAiB,UAAU,MAAM,SAAS,KAAK,MAAM,UAAU,OAAO,gBAAgB,UAAU;AAAA,EACtG;AAAA,EAEO,KAAK,gBAAyB,YAA+B;AACnE,SAAK,iBAAiB,UAAU,KAAK,SAAS,KAAK,MAAM,UAAU,MAAM,gBAAgB,UAAU;AAAA,EACpG;AAAA,EAEO,KAAK,gBAAyB,YAA+B;AACnE,SAAK,iBAAiB,UAAU,KAAK,SAAS,KAAK,MAAM,UAAU,MAAM,gBAAgB,UAAU;AAAA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MACA,eAAe;AAAA,MACf,MAAM;AAAA,MACN,SAAS,IAAI,YAAA;AAAA,MACb,OAAO,KAAK;AAAA,MACZ,kBAAkB,KAAK;AAAA,MACvB,QAAQ,MAAM;AACb,eAAO,cAAA,YAAc;AAAA,UACpB,YAAY,yBAAyB,KAAK,uBAAA,GAA0B,KAAK;AAAA,UACzE,SAAS,UAAU,MAAM,OAAO;AAAA,UAChC,OAAO,MAAM,QAAQ,cAAc,UAAU,MAAM,KAAK,CAAC,KAAK;AAAA,QAAA;AAAA,MAEhE;AAAA,IAAA;AAED,SAAK,QAAQ,OAAO,KAAK;AAAA,EAC1B;AAAA,EAEA,WAAW,SAA8B;AACxC,QAAI,CAAC,KAAK,aAAa;AACtB,WAAK,cAAc,IAAI,kBAAkB,CAAC,KAAK,OAAO,CAAC;AACvD,WAAK,UAAU,KAAK;AAAA,IACrB;AACA,SAAK,YAAY,WAAW,OAAO;AACnC,SAAK,gBAAgB,KAAK,IAAI,KAAK,eAAe,QAAQ,aAAa;AAAA,EACxE;AAAA,EAEA,QAAc;AACb,SAAK,QAAQ,MAAA;AAAA,EACd;AAAA,EAEQ,yBAA8C;AACrD,QAAI,KAAK,qBAAqB;AAC7B,aAAO,KAAK;AAAA,IACb;AACA,UAAM,mBAAmB,KAAK,QAAQ,uBAAA;AACtC,SAAK,sBAAsB,uBAAuB,kBAAkB,KAAK,aAAa;AACtF,WAAO,KAAK;AAAA,EACb;AACD;"}
|
|
1
|
+
{"version":3,"file":"impl.js","sources":["../../../../packages/logger/src/impl.ts"],"sourcesContent":["import {\n\tLogEntry,\n\tLogEntryFormatted,\n\tLogger,\n\tLoggerAttributes,\n\tLoggerChildOptions,\n\tLoggerHandler,\n\tLoggerOptions,\n\tLogLevel,\n\tLogLevelName,\n} from './types.js'\nimport { LogLevels } from './levels.js'\nimport { formatLogEntryAttributes, formatLoggerAttributes, FormattedAttributes, stringify } from './formatting.js'\nimport { LoggerHandlerList } from './handlers/LoggerHandlerList.js'\nimport { withLogger } from './proxy.js'\n\nexport const createLogger = (\n\thandler: LoggerHandler,\n\tattributes: LoggerAttributes = {},\n\toptions: LoggerOptions = {},\n): Logger => {\n\treturn LoggerImpl.create(handler, attributes, options)\n}\n\nexport class LoggerImpl implements Logger {\n\tpublic readonly attributes: LoggerAttributes\n\tprivate formattedAttributes: FormattedAttributes | undefined\n\tprivate minLevelValue: number\n\tprivate handlerList: LoggerHandlerList | undefined\n\n\tprivate constructor(\n\t\tprivate handler: LoggerHandler,\n\t\tprivate readonly ownAttributes: LoggerAttributes,\n\t\tprivate readonly depth: number,\n\t\tprivate readonly parent: LoggerImpl | undefined,\n\t\tprivate readonly options: LoggerOptions,\n\t) {\n\t\tthis.attributes = { ...parent?.attributes, ...ownAttributes }\n\t\tthis.minLevelValue = handler.getMinLevel()\n\t}\n\n\tpublic static create(\n\t\thandler: LoggerHandler,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: LoggerOptions = {},\n\t) {\n\t\treturn new LoggerImpl(handler, attributes, 0, undefined, options)\n\t}\n\n\tpublic crit(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.crit.value && this.doLog(LogLevels.crit, messageOrError, attributes)\n\t}\n\n\tpublic error(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.error.value && this.doLog(LogLevels.error, messageOrError, attributes)\n\t}\n\n\tpublic warn(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.warn.value && this.doLog(LogLevels.warn, messageOrError, attributes)\n\t}\n\n\tpublic info(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.info.value && this.doLog(LogLevels.info, messageOrError, attributes)\n\t}\n\n\tpublic debug(messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tthis.minLevelValue <= LogLevels.debug.value && this.doLog(LogLevels.debug, messageOrError, attributes)\n\t}\n\n\tpublic log(levelName: LogLevelName, messageOrError: unknown, attributes?: LoggerAttributes) {\n\t\tconst level = LogLevels[levelName]\n\t\tthis.minLevelValue <= level.value && this.doLog(level, messageOrError, attributes)\n\t}\n\n\tpublic child(attributes: LoggerAttributes = {}, options: Partial<LoggerChildOptions> = {}): Logger {\n\t\tconst newHandler = options.handler ? options.handler(this.handler, this.options) : this.handler\n\t\treturn new LoggerImpl(newHandler, attributes, this.depth + 1, this, { ...this.options, ...options })\n\t}\n\n\tpublic async scope<T>(\n\t\tcb: (logger: Logger) => Promise<T> | T,\n\t\tattributes: LoggerAttributes = {},\n\t\toptions: Partial<LoggerChildOptions> = {},\n\t): Promise<T> {\n\t\tconst logger = this.child(attributes, options)\n\t\ttry {\n\t\t\treturn await withLogger(logger, () => cb(logger))\n\t\t} finally {\n\t\t\tlogger.close()\n\t\t}\n\t}\n\n\tprivate doLog(level: LogLevel, errorOrMessage: unknown, { error: errorAttr, message: messageAttr, ...attributes }: LoggerAttributes = {}) {\n\t\tconst error: unknown | undefined = typeof errorOrMessage !== 'string' ? errorOrMessage : errorAttr\n\t\tconst errorMessage = typeof error === 'object' && error !== null && typeof (error as any).message === 'string'\n\t\t\t? (error as any).message\n\t\t\t: undefined\n\n\t\tconst passedMessage = typeof errorOrMessage === 'string'\n\t\t\t? errorOrMessage\n\t\t\t: (typeof messageAttr === 'string')\n\t\t\t? messageAttr\n\t\t\t: undefined\n\n\t\tconst message = errorMessage && passedMessage ? `${passedMessage}: ${errorMessage}` : (passedMessage ?? errorMessage ?? 'undefined message')\n\n\t\tconst now = new Date()\n\t\tlet formatted: LogEntryFormatted\n\t\tconst entry: LogEntry = {\n\t\t\tlevel,\n\t\t\terror,\n\t\t\tmessage,\n\t\t\townAttributes: attributes,\n\t\t\ttime: now,\n\t\t\tisoTime: now.toISOString(),\n\t\t\tdepth: this.depth,\n\t\t\tloggerAttributes: this.attributes,\n\t\t\tformat: () => {\n\t\t\t\treturn formatted ??= {\n\t\t\t\t\tattributes: formatLogEntryAttributes(this.getFormattedAttributes(), entry),\n\t\t\t\t\tmessage: stringify(entry.message),\n\t\t\t\t\terror: entry.error ? `, \"error\": ${stringify(entry.error)}` : '',\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t\tthis.handler.handle(entry)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tif (!this.handlerList) {\n\t\t\tthis.handlerList = new LoggerHandlerList([this.handler])\n\t\t\tthis.handler = this.handlerList\n\t\t}\n\t\tthis.handlerList.addHandler(handler)\n\t\tthis.minLevelValue = Math.min(this.minLevelValue, handler.getMinLevel())\n\t}\n\n\tclose(): void {\n\t\tthis.handler.close()\n\t}\n\n\tprivate getFormattedAttributes(): FormattedAttributes {\n\t\tif (this.formattedAttributes) {\n\t\t\treturn this.formattedAttributes\n\t\t}\n\t\tconst parentAttributes = this.parent?.getFormattedAttributes()\n\t\tthis.formattedAttributes = formatLoggerAttributes(parentAttributes, this.ownAttributes)\n\t\treturn this.formattedAttributes\n\t}\n}\n"],"names":[],"mappings":";;;;;;;AAgBO,MAAM,eAAe,CAC3B,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,MACb;AACZ,SAAO,WAAW,OAAO,SAAS,YAAY,OAAO;AACtD;AAEO,MAAM,WAA6B;AAAA,EAMjC,YACC,SACS,eACA,OACA,QACA,SAChB;AALO,SAAA,UAAA;AACS,SAAA,gBAAA;AACA,SAAA,QAAA;AACA,SAAA,SAAA;AACA,SAAA,UAAA;AAVlB,kBAAA,MAAgB,YAAA;AAChB,kBAAA,MAAQ,qBAAA;AACR,kBAAA,MAAQ,eAAA;AACR,kBAAA,MAAQ,aAAA;AASP,SAAK,aAAa,EAAE,GAAG,QAAQ,YAAY,GAAG,cAAA;AAC9C,SAAK,gBAAgB,QAAQ,YAAA;AAAA,EAC9B;AAAA,EAEA,OAAc,OACb,SACA,aAA+B,CAAA,GAC/B,UAAyB,CAAA,GACxB;AACD,WAAO,IAAI,WAAW,SAAS,YAAY,GAAG,QAAW,OAAO;AAAA,EACjE;AAA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KAAK;AAAA,IACb;AACA,UAAM,mBAAmB,KAAK,QAAQ,uBAAA;AACtC,SAAK,sBAAsB,uBAAuB,kBAAkB,KAAK,aAAa;AACtF,WAAO,KAAK;AAAA,EACb;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levels.cjs","sources":["../../../../packages/logger/src/levels.ts"],"sourcesContent":["import { LogLevelName } from './types'\n\nexport const LogLevels: { [K in LogLevelName]: { name: K; value: number } } = {\n\tdebug: { name: 'debug', value: 10 },\n\tinfo: { name: 'info', value: 20 },\n\twarn: { name: 'warn', value: 30 },\n\terror: { name: 'error', value: 40 },\n\tcrit: { name: 'crit', value: 50 },\n}\n"],"names":[],"mappings":";;AAEO,MAAM,YAAiE;AAAA,EAC7E,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAC9B;;"}
|
|
1
|
+
{"version":3,"file":"levels.cjs","sources":["../../../../packages/logger/src/levels.ts"],"sourcesContent":["import { LogLevelName } from './types.js'\n\nexport const LogLevels: { [K in LogLevelName]: { name: K; value: number } } = {\n\tdebug: { name: 'debug', value: 10 },\n\tinfo: { name: 'info', value: 20 },\n\twarn: { name: 'warn', value: 30 },\n\terror: { name: 'error', value: 40 },\n\tcrit: { name: 'crit', value: 50 },\n}\n"],"names":[],"mappings":";;AAEO,MAAM,YAAiE;AAAA,EAC7E,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAC9B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levels.js","sources":["../../../../packages/logger/src/levels.ts"],"sourcesContent":["import { LogLevelName } from './types'\n\nexport const LogLevels: { [K in LogLevelName]: { name: K; value: number } } = {\n\tdebug: { name: 'debug', value: 10 },\n\tinfo: { name: 'info', value: 20 },\n\twarn: { name: 'warn', value: 30 },\n\terror: { name: 'error', value: 40 },\n\tcrit: { name: 'crit', value: 50 },\n}\n"],"names":[],"mappings":"AAEO,MAAM,YAAiE;AAAA,EAC7E,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAC9B;"}
|
|
1
|
+
{"version":3,"file":"levels.js","sources":["../../../../packages/logger/src/levels.ts"],"sourcesContent":["import { LogLevelName } from './types.js'\n\nexport const LogLevels: { [K in LogLevelName]: { name: K; value: number } } = {\n\tdebug: { name: 'debug', value: 10 },\n\tinfo: { name: 'info', value: 20 },\n\twarn: { name: 'warn', value: 30 },\n\terror: { name: 'error', value: 40 },\n\tcrit: { name: 'crit', value: 50 },\n}\n"],"names":[],"mappings":"AAEO,MAAM,YAAiE;AAAA,EAC7E,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAAA,EAC7B,OAAO,EAAE,MAAM,SAAS,OAAO,GAAA;AAAA,EAC/B,MAAM,EAAE,MAAM,QAAQ,OAAO,GAAA;AAC9B;"}
|
|
@@ -48,7 +48,9 @@ const getLogger = () => {
|
|
|
48
48
|
}
|
|
49
49
|
return logger2;
|
|
50
50
|
};
|
|
51
|
+
const tryGetLogger = () => loggerStore.getStore();
|
|
51
52
|
exports.getLogger = getLogger;
|
|
52
53
|
exports.logger = logger;
|
|
54
|
+
exports.tryGetLogger = tryGetLogger;
|
|
53
55
|
exports.withLogger = withLogger;
|
|
54
56
|
//# sourceMappingURL=proxy.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.cjs","sources":["../../../../packages/logger/src/proxy.ts"],"sourcesContent":["import { Logger, LoggerAttributes, LoggerHandler, LoggerOptions } from './types'\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nconst loggerStore = new AsyncLocalStorage<Logger>()\n\nclass CurrentLoggerProxy implements Logger {\n\tcrit(a: any, b?: any, c?: any) {\n\t\tgetLogger().crit(a, b)\n\t}\n\n\terror(a: any, b?: any, c?: any) {\n\t\tgetLogger().error(a, b)\n\t}\n\n\twarn(a: any, b?: any, c?: any) {\n\t\tgetLogger().warn(a, b)\n\t}\n\n\tinfo(a: any, b?: any, c?: any) {\n\t\tgetLogger().info(a, b)\n\t}\n\n\tdebug(a: any, b?: any, c?: any) {\n\t\tgetLogger().debug(a, b)\n\t}\n\n\tlog(level: any, a: any, b?: any, c?: any) {\n\t\tgetLogger().log(level, a, b)\n\t}\n\n\tchild(attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Logger {\n\t\treturn getLogger().child(attributes, options)\n\t}\n\n\tget attributes() {\n\t\treturn getLogger().attributes\n\t}\n\n\tclose(): void {\n\t\tgetLogger().close()\n\t}\n\n\tscope<T>(cb: (logger: Logger) => Promise<T> | T, attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Promise<T> {\n\t\treturn getLogger().scope(cb, attributes, options)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tgetLogger().addHandler(handler)\n\t}\n}\n\nexport const logger: Logger = new CurrentLoggerProxy()\n\nexport const withLogger = <R>(logger: Logger, callback: () => R): R => {\n\treturn loggerStore.run(logger, callback)\n}\n\nexport const getLogger = (): Logger => {\n\tconst logger = loggerStore.getStore()\n\tif (!logger) {\n\t\tthrow new Error('Logger was not set')\n\t}\n\treturn logger\n}\n"],"names":["AsyncLocalStorage","logger"],"mappings":";;;AAGA,MAAM,cAAc,IAAIA,iBAAAA,kBAAA;AAExB,MAAM,mBAAqC;AAAA,EAC1C,KAAK,GAAQ,GAAS,GAAS;AAC9B,gBAAY,KAAK,GAAG,CAAC;AAAA,EACtB;AAAA,EAEA,MAAM,GAAQ,GAAS,GAAS;AAC/B,gBAAY,MAAM,GAAG,CAAC;AAAA,EACvB;AAAA,EAEA,KAAK,GAAQ,GAAS,GAAS;AAC9B,gBAAY,KAAK,GAAG,CAAC;AAAA,EACtB;AAAA,EAEA,KAAK,GAAQ,GAAS,GAAS;AAC9B,gBAAY,KAAK,GAAG,CAAC;AAAA,EACtB;AAAA,EAEA,MAAM,GAAQ,GAAS,GAAS;AAC/B,gBAAY,MAAM,GAAG,CAAC;AAAA,EACvB;AAAA,EAEA,IAAI,OAAY,GAAQ,GAAS,GAAS;AACzC,cAAA,EAAY,IAAI,OAAO,GAAG,CAAC;AAAA,EAC5B;AAAA,EAEA,MAAM,YAA+B,SAA0C;AAC9E,WAAO,UAAA,EAAY,MAAM,YAAY,OAAO;AAAA,EAC7C;AAAA,EAEA,IAAI,aAAa;AAChB,WAAO,YAAY;AAAA,EACpB;AAAA,EAEA,QAAc;AACb,cAAA,EAAY,MAAA;AAAA,EACb;AAAA,EAEA,MAAS,IAAwC,YAA+B,SAA8C;AAC7H,WAAO,UAAA,EAAY,MAAM,IAAI,YAAY,OAAO;AAAA,EACjD;AAAA,EAEA,WAAW,SAA8B;AACxC,cAAA,EAAY,WAAW,OAAO;AAAA,EAC/B;AACD;AAEO,MAAM,SAAiB,IAAI,mBAAA;AAE3B,MAAM,aAAa,CAAIC,SAAgB,aAAyB;AACtE,SAAO,YAAY,IAAIA,SAAQ,QAAQ;AACxC;AAEO,MAAM,YAAY,MAAc;AACtC,QAAMA,UAAS,YAAY,SAAA;AAC3B,MAAI,CAACA,SAAQ;AACZ,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACrC;AACA,SAAOA;AACR
|
|
1
|
+
{"version":3,"file":"proxy.cjs","sources":["../../../../packages/logger/src/proxy.ts"],"sourcesContent":["import { Logger, LoggerAttributes, LoggerHandler, LoggerOptions } from './types.js'\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nconst loggerStore = new AsyncLocalStorage<Logger>()\n\nclass CurrentLoggerProxy implements Logger {\n\tcrit(a: any, b?: any, c?: any) {\n\t\tgetLogger().crit(a, b)\n\t}\n\n\terror(a: any, b?: any, c?: any) {\n\t\tgetLogger().error(a, b)\n\t}\n\n\twarn(a: any, b?: any, c?: any) {\n\t\tgetLogger().warn(a, b)\n\t}\n\n\tinfo(a: any, b?: any, c?: any) {\n\t\tgetLogger().info(a, b)\n\t}\n\n\tdebug(a: any, b?: any, c?: any) {\n\t\tgetLogger().debug(a, b)\n\t}\n\n\tlog(level: any, a: any, b?: any, c?: any) {\n\t\tgetLogger().log(level, a, b)\n\t}\n\n\tchild(attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Logger {\n\t\treturn getLogger().child(attributes, options)\n\t}\n\n\tget attributes() {\n\t\treturn getLogger().attributes\n\t}\n\n\tclose(): void {\n\t\tgetLogger().close()\n\t}\n\n\tscope<T>(cb: (logger: Logger) => Promise<T> | T, attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Promise<T> {\n\t\treturn getLogger().scope(cb, attributes, options)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tgetLogger().addHandler(handler)\n\t}\n}\n\nexport const logger: Logger = new CurrentLoggerProxy()\n\nexport const withLogger = <R>(logger: Logger, callback: () => R): R => {\n\treturn loggerStore.run(logger, callback)\n}\n\nexport const getLogger = (): Logger => {\n\tconst logger = loggerStore.getStore()\n\tif (!logger) {\n\t\tthrow new Error('Logger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AACA,SAAQ;AACZ,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACrC;AACA,SAAOA;AACR;AAEO,MAAM,eAAe,MAA0B,YAAY,SAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sources":["../../../../packages/logger/src/proxy.ts"],"sourcesContent":["import { Logger, LoggerAttributes, LoggerHandler, LoggerOptions } from './types'\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nconst loggerStore = new AsyncLocalStorage<Logger>()\n\nclass CurrentLoggerProxy implements Logger {\n\tcrit(a: any, b?: any, c?: any) {\n\t\tgetLogger().crit(a, b)\n\t}\n\n\terror(a: any, b?: any, c?: any) {\n\t\tgetLogger().error(a, b)\n\t}\n\n\twarn(a: any, b?: any, c?: any) {\n\t\tgetLogger().warn(a, b)\n\t}\n\n\tinfo(a: any, b?: any, c?: any) {\n\t\tgetLogger().info(a, b)\n\t}\n\n\tdebug(a: any, b?: any, c?: any) {\n\t\tgetLogger().debug(a, b)\n\t}\n\n\tlog(level: any, a: any, b?: any, c?: any) {\n\t\tgetLogger().log(level, a, b)\n\t}\n\n\tchild(attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Logger {\n\t\treturn getLogger().child(attributes, options)\n\t}\n\n\tget attributes() {\n\t\treturn getLogger().attributes\n\t}\n\n\tclose(): void {\n\t\tgetLogger().close()\n\t}\n\n\tscope<T>(cb: (logger: Logger) => Promise<T> | T, attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Promise<T> {\n\t\treturn getLogger().scope(cb, attributes, options)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tgetLogger().addHandler(handler)\n\t}\n}\n\nexport const logger: Logger = new CurrentLoggerProxy()\n\nexport const withLogger = <R>(logger: Logger, callback: () => R): R => {\n\treturn loggerStore.run(logger, callback)\n}\n\nexport const getLogger = (): Logger => {\n\tconst logger = loggerStore.getStore()\n\tif (!logger) {\n\t\tthrow new Error('Logger was not set')\n\t}\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|
1
|
+
{"version":3,"file":"proxy.js","sources":["../../../../packages/logger/src/proxy.ts"],"sourcesContent":["import { Logger, LoggerAttributes, LoggerHandler, LoggerOptions } from './types.js'\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nconst loggerStore = new AsyncLocalStorage<Logger>()\n\nclass CurrentLoggerProxy implements Logger {\n\tcrit(a: any, b?: any, c?: any) {\n\t\tgetLogger().crit(a, b)\n\t}\n\n\terror(a: any, b?: any, c?: any) {\n\t\tgetLogger().error(a, b)\n\t}\n\n\twarn(a: any, b?: any, c?: any) {\n\t\tgetLogger().warn(a, b)\n\t}\n\n\tinfo(a: any, b?: any, c?: any) {\n\t\tgetLogger().info(a, b)\n\t}\n\n\tdebug(a: any, b?: any, c?: any) {\n\t\tgetLogger().debug(a, b)\n\t}\n\n\tlog(level: any, a: any, b?: any, c?: any) {\n\t\tgetLogger().log(level, a, b)\n\t}\n\n\tchild(attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Logger {\n\t\treturn getLogger().child(attributes, options)\n\t}\n\n\tget attributes() {\n\t\treturn getLogger().attributes\n\t}\n\n\tclose(): void {\n\t\tgetLogger().close()\n\t}\n\n\tscope<T>(cb: (logger: Logger) => Promise<T> | T, attributes?: LoggerAttributes, options?: Partial<LoggerOptions>): Promise<T> {\n\t\treturn getLogger().scope(cb, attributes, options)\n\t}\n\n\taddHandler(handler: LoggerHandler): void {\n\t\tgetLogger().addHandler(handler)\n\t}\n}\n\nexport const logger: Logger = new CurrentLoggerProxy()\n\nexport const withLogger = <R>(logger: Logger, callback: () => R): R => {\n\treturn loggerStore.run(logger, callback)\n}\n\nexport const getLogger = (): Logger => {\n\tconst logger = loggerStore.getStore()\n\tif (!logger) {\n\t\tthrow new Error('Logger was not set')\n\t}\n\treturn logger\n}\n\nexport const tryGetLogger = (): Logger | undefined => loggerStore.getStore()\n"],"names":["logger"],"mappings":";AAGA,MAAM,cAAc,IAAI,kBAAA;AAExB,MAAM,mBAAqC;AAAA,EAC1C,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ogLevels = levels.LogLevels;
|
|
14
14
|
exports.getLogger = proxy.getLogger;
|
|
15
15
|
exports.logger = proxy.logger;
|
|
16
|
+
exports.tryGetLogger = proxy.tryGetLogger;
|
|
16
17
|
exports.withLogger = proxy.withLogger;
|
|
17
18
|
exports.FingerCrossedLoggerHandler = FingerCrossedLoggerHandler.FingerCrossedLoggerHandler;
|
|
18
19
|
exports.JsonStreamLoggerHandler = JsonStreamLoggerHandler.JsonStreamLoggerHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/production/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "./src/impl.js";
|
|
2
2
|
import { LogLevels } from "./src/levels.js";
|
|
3
|
-
import { getLogger, logger, withLogger } from "./src/proxy.js";
|
|
3
|
+
import { getLogger, logger, tryGetLogger, withLogger } from "./src/proxy.js";
|
|
4
4
|
import { FingerCrossedLoggerHandler } from "./src/handlers/FingerCrossedLoggerHandler.js";
|
|
5
5
|
import { JsonStreamLoggerHandler } from "./src/handlers/JsonStreamLoggerHandler.js";
|
|
6
6
|
import { PrettyPrintLoggerHandler } from "./src/handlers/PrettyPrintLoggerHandler.js";
|
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
createLogger,
|
|
19
19
|
getLogger,
|
|
20
20
|
logger,
|
|
21
|
+
tryGetLogger,
|
|
21
22
|
withLogger
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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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O;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,UAAUA,UAAAA,QAAQ,KAAK,CAAC;AAAA,EACrC;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"formatting.cjs","sources":["../../../../packages/logger/src/formatting.ts"],"sourcesContent":["import { LogEntry, LoggerAttributes } from './types.js'\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,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,UAAUA,UAAAA,QAAQ,KAAK,CAAC;AAAA,EACrC;AACD;;;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"formatting.js","sources":["../../../../packages/logger/src/formatting.ts"],"sourcesContent":["import { LogEntry, LoggerAttributes } from './types.js'\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,kBAA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,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B,QAAQ;AACP,WAAO,KAAK,UAAU,QAAQ,KAAK,CAAC;AAAA,EACrC;AACD;"}
|
|
@@ -1 +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\t\t\t\tthis.inner.handle(entry)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["LogLevels"],"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,gBAAgBA,OAAAA,UAAU;AAAA,MAC1B,uBAAuBA,OAAAA,UAAU;AAAA,MACjC,iBAAiBA,OAAAA,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,Q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,"file":"FingerCrossedLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/FingerCrossedLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LoggerHandlerFactory, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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":["LogLevels"],"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,gBAAgBA,OAAAA,UAAU;AAAA,MAC1B,uBAAuBA,OAAAA,UAAU;AAAA,MACjC,iBAAiBA,OAAAA,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;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"FingerCrossedLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/FingerCrossedLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LoggerHandlerFactory, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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;"}
|
|
@@ -1 +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;;"}
|
|
1
|
+
{"version":3,"file":"JsonStreamLoggerHandler.cjs","sources":["../../../../../packages/logger/src/handlers/JsonStreamLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"JsonStreamLoggerHandler.js","sources":["../../../../../packages/logger/src/handlers/JsonStreamLoggerHandler.ts"],"sourcesContent":["import { LogEntry, LoggerHandler, LogLevel } from '../types.js'\nimport { LogLevels } from '../levels.js'\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;"}
|
|
@@ -1 +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;;"}
|
|
1
|
+
{"version":3,"file":"LoggerHandlerList.cjs","sources":["../../../../../packages/logger/src/handlers/LoggerHandlerList.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types.js'\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;;"}
|
|
@@ -1 +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;"}
|
|
1
|
+
{"version":3,"file":"LoggerHandlerList.js","sources":["../../../../../packages/logger/src/handlers/LoggerHandlerList.ts"],"sourcesContent":["import { LogEntry, LoggerHandler } from '../types.js'\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;"}
|