@orpc/experimental-pino 0.0.0-next.8606faa → 0.0.0-next.bbe55b7
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.mjs +3 -3
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mapEventIterator } from '@orpc/client';
|
|
2
|
-
import { isAsyncIteratorObject, overlayProxy } from '@orpc/shared';
|
|
2
|
+
import { ORPC_NAME, isAsyncIteratorObject, overlayProxy } from '@orpc/shared';
|
|
3
3
|
import pino from 'pino';
|
|
4
4
|
|
|
5
5
|
const CONTEXT_LOGGER_SYMBOL = Symbol("ORPC_PINO_CONTEXT_LOGGER_SYMBOL");
|
|
@@ -24,7 +24,7 @@ class LoggingHandlerPlugin {
|
|
|
24
24
|
options.clientInterceptors ??= [];
|
|
25
25
|
options.rootInterceptors.unshift(async (interceptorOptions) => {
|
|
26
26
|
const logger = (interceptorOptions.context[CONTEXT_LOGGER_SYMBOL] ?? this.logger).child({
|
|
27
|
-
|
|
27
|
+
rpc: { id: this.generateId(interceptorOptions), system: ORPC_NAME }
|
|
28
28
|
});
|
|
29
29
|
if (!logger.bindings().req) {
|
|
30
30
|
logger.setBindings({
|
|
@@ -93,7 +93,7 @@ class LoggingHandlerPlugin {
|
|
|
93
93
|
});
|
|
94
94
|
options.clientInterceptors.unshift(async ({ next, path, context, signal }) => {
|
|
95
95
|
const logger = getLogger(context);
|
|
96
|
-
logger?.setBindings({
|
|
96
|
+
logger?.setBindings({ rpc: { ...logger.bindings().rpc, method: path.join(".") } });
|
|
97
97
|
const output = await next();
|
|
98
98
|
if (isAsyncIteratorObject(output)) {
|
|
99
99
|
return overlayProxy(output, mapEventIterator(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/experimental-pino",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.bbe55b7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"pino": ">=10.1.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@orpc/client": "0.0.0-next.
|
|
31
|
-
"@orpc/
|
|
32
|
-
"@orpc/
|
|
30
|
+
"@orpc/client": "0.0.0-next.bbe55b7",
|
|
31
|
+
"@orpc/shared": "0.0.0-next.bbe55b7",
|
|
32
|
+
"@orpc/server": "0.0.0-next.bbe55b7"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"pino": "^10.1.0"
|