@alistigo/logger 0.2.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/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +28 -0
- package/package.json +27 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LevelWithSilent, Logger } from "pino";
|
|
2
|
+
export type { Logger, LevelWithSilent };
|
|
3
|
+
export declare const setLogLevel: (level: LevelWithSilent) => void;
|
|
4
|
+
export declare const createLogger: (module: string, ctx?: Record<string, unknown>) => Logger;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGpD,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;AAUxC,eAAO,MAAM,WAAW,GAAI,OAAO,eAAe,KAAG,IAEpD,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAC7C,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import pino from "pino";
|
|
2
|
+
// Root logger — starts silent. App entry points call setLogLevel() before rendering.
|
|
3
|
+
// Changing root.level propagates to all child loggers at write time (pino checks the
|
|
4
|
+
// root level before forwarding to its transport).
|
|
5
|
+
const root = pino({
|
|
6
|
+
level: "silent",
|
|
7
|
+
browser: { asObject: true },
|
|
8
|
+
});
|
|
9
|
+
export const setLogLevel = (level) => {
|
|
10
|
+
root.level = level;
|
|
11
|
+
};
|
|
12
|
+
// Creates a child logger with a bound `module` field on every log entry.
|
|
13
|
+
// Optionally accepts additional static context (e.g. { listId }).
|
|
14
|
+
export const createLogger = (module, ctx) => root.child({ module, ...ctx });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,qFAAqF;AACrF,qFAAqF;AACrF,kDAAkD;AAClD,MAAM,IAAI,GAAG,IAAI,CAAC;IAChB,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAsB,EAAQ,EAAE;IAC1D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACrB,CAAC,CAAC;AAEF,yEAAyE;AACzE,kEAAkE;AAClE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,GAA6B,EAAU,EAAE,CACpF,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alistigo/logger",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Shared pino-based logger for Alistigo apps and packages. Wraps pino with a singleton root logger and a createLogger factory for named child loggers.",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"pino": "^9.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.0.0"
|
|
26
|
+
},
|
|
27
|
+
"module": "./index.js"
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alistigo/logger",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Shared pino-based logger for Alistigo apps and packages. Wraps pino with a singleton root logger and a createLogger factory for named child loggers.",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"pino": "^9.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.0.0"
|
|
26
|
+
}
|
|
27
|
+
}
|