@webiny/logger 6.0.0-alpha.0 → 6.0.0-alpha.2
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/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DestinationStream, LevelWithSilent, Logger, LoggerOptions as BaseLoggerOptions } from "pino";
|
|
1
|
+
import type { DestinationStream, LevelWithSilent, Logger, LoggerOptions as BaseLoggerOptions } from "pino";
|
|
2
2
|
export * from "pino";
|
|
3
3
|
export interface RedactOptions {
|
|
4
4
|
paths: string[];
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pino","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","levels","getLogLevel","input","defaultLevel","process","env","LOG_LEVEL","length","includes","logger","createPinoLogger","stream","options","level","pino","configureLogger","getLogger"],"sources":["index.ts"],"sourcesContent":["import {\n DestinationStream,\n LevelWithSilent,\n Logger,\n LoggerOptions as BaseLoggerOptions
|
|
1
|
+
{"version":3,"names":["_pino","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","levels","getLogLevel","input","defaultLevel","process","env","LOG_LEVEL","length","includes","logger","createPinoLogger","stream","options","level","pino","configureLogger","getLogger"],"sources":["index.ts"],"sourcesContent":["import type {\n DestinationStream,\n LevelWithSilent,\n Logger,\n LoggerOptions as BaseLoggerOptions\n} from \"pino\";\nimport { pino } from \"pino\";\n\nexport * from \"pino\";\n\nexport interface RedactOptions {\n paths: string[];\n censor?: string | ((value: any, path: string[]) => any);\n remove?: boolean;\n}\n\nexport interface LoggerOptions extends Omit<BaseLoggerOptions, \"redact\"> {\n redact?: string[] | RedactOptions;\n}\n\nconst levels: LevelWithSilent[] = [\"fatal\", \"error\", \"warn\", \"info\", \"debug\", \"trace\", \"silent\"];\n/**\n * Gets the log level from the input or the LOG_LEVEL environment variable.\n */\nexport const getLogLevel = (input?: string, defaultLevel: LevelWithSilent = \"info\"): string => {\n input = input || process.env.LOG_LEVEL;\n if (!input || input.length === 0) {\n return defaultLevel;\n }\n return levels.includes(input as LevelWithSilent) ? input : defaultLevel;\n};\n\nlet logger: Logger;\n\nexport const createPinoLogger = (input?: LoggerOptions, stream?: DestinationStream): Logger => {\n const options = {\n ...(input || {}),\n level: getLogLevel(input?.level)\n };\n if (!stream) {\n return pino(options);\n }\n return pino(options, stream);\n};\n\nexport const configureLogger = (options: LoggerOptions, stream?: DestinationStream): void => {\n logger = createPinoLogger(options, stream);\n};\n\nexport const getLogger = () => {\n if (!logger) {\n logger = createPinoLogger();\n }\n return logger;\n};\n"],"mappings":";;;;;;;;;;;;AAMA,IAAAA,KAAA,GAAAC,OAAA;AAEAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAYA,MAAMS,MAAyB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;AAChG;AACA;AACA;AACO,MAAMC,WAAW,GAAGA,CAACC,KAAc,EAAEC,YAA6B,GAAG,MAAM,KAAa;EAC3FD,KAAK,GAAGA,KAAK,IAAIE,OAAO,CAACC,GAAG,CAACC,SAAS;EACtC,IAAI,CAACJ,KAAK,IAAIA,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;IAC9B,OAAOJ,YAAY;EACvB;EACA,OAAOH,MAAM,CAACQ,QAAQ,CAACN,KAAwB,CAAC,GAAGA,KAAK,GAAGC,YAAY;AAC3E,CAAC;AAACP,OAAA,CAAAK,WAAA,GAAAA,WAAA;AAEF,IAAIQ,MAAc;AAEX,MAAMC,gBAAgB,GAAGA,CAACR,KAAqB,EAAES,MAA0B,KAAa;EAC3F,MAAMC,OAAO,GAAG;IACZ,IAAIV,KAAK,IAAI,CAAC,CAAC,CAAC;IAChBW,KAAK,EAAEZ,WAAW,CAACC,KAAK,EAAEW,KAAK;EACnC,CAAC;EACD,IAAI,CAACF,MAAM,EAAE;IACT,OAAO,IAAAG,UAAI,EAACF,OAAO,CAAC;EACxB;EACA,OAAO,IAAAE,UAAI,EAACF,OAAO,EAAED,MAAM,CAAC;AAChC,CAAC;AAACf,OAAA,CAAAc,gBAAA,GAAAA,gBAAA;AAEK,MAAMK,eAAe,GAAGA,CAACH,OAAsB,EAAED,MAA0B,KAAW;EACzFF,MAAM,GAAGC,gBAAgB,CAACE,OAAO,EAAED,MAAM,CAAC;AAC9C,CAAC;AAACf,OAAA,CAAAmB,eAAA,GAAAA,eAAA;AAEK,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC3B,IAAI,CAACP,MAAM,EAAE;IACTA,MAAM,GAAGC,gBAAgB,CAAC,CAAC;EAC/B;EACA,OAAOD,MAAM;AACjB,CAAC;AAACb,OAAA,CAAAoB,SAAA,GAAAA,SAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/logger",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@webiny/project-utils": "6.0.0-alpha.
|
|
15
|
+
"@webiny/project-utils": "6.0.0-alpha.2",
|
|
16
16
|
"pino": "8.21.0",
|
|
17
17
|
"rimraf": "6.0.1",
|
|
18
18
|
"typescript": "5.3.3"
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"build": "node ../cli/bin.js run build",
|
|
26
26
|
"watch": "node ../cli/bin.js run watch"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "7c9e8fbfd62a57ece5f880dbad6c864636b0355e"
|
|
29
29
|
}
|