@dasasian/firebase-structured-logger 0.6.0 → 0.8.0
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/README.md +669 -103
- package/dist/client/logger.d.ts.map +1 -1
- package/dist/client/logger.js +16 -2
- package/dist/client/logger.js.map +1 -1
- package/dist/functions/httpHandler.d.ts +89 -0
- package/dist/functions/httpHandler.d.ts.map +1 -0
- package/dist/functions/httpHandler.js +115 -0
- package/dist/functions/httpHandler.js.map +1 -0
- package/dist/functions/index.d.ts +5 -2
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +6 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/logHandler.d.ts +55 -3
- package/dist/functions/logHandler.d.ts.map +1 -1
- package/dist/functions/logHandler.js +51 -8
- package/dist/functions/logHandler.js.map +1 -1
- package/dist/functions/logger.d.ts +13 -0
- package/dist/functions/logger.d.ts.map +1 -1
- package/dist/functions/logger.js +128 -14
- package/dist/functions/logger.js.map +1 -1
- package/dist/functions/sourceMapCache.d.ts +39 -3
- package/dist/functions/sourceMapCache.d.ts.map +1 -1
- package/dist/functions/sourceMapCache.js +176 -12
- package/dist/functions/sourceMapCache.js.map +1 -1
- package/dist/functions/traceContext.d.ts +54 -0
- package/dist/functions/traceContext.d.ts.map +1 -0
- package/dist/functions/traceContext.js +141 -0
- package/dist/functions/traceContext.js.map +1 -0
- package/dist/shared/paths.d.ts +59 -0
- package/dist/shared/paths.d.ts.map +1 -0
- package/dist/shared/paths.js +126 -0
- package/dist/shared/paths.js.map +1 -0
- package/dist/tools/index.js +13 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/uploadSourceMaps.d.ts +24 -1
- package/dist/tools/uploadSourceMaps.d.ts.map +1 -1
- package/dist/tools/uploadSourceMaps.js +31 -4
- package/dist/tools/uploadSourceMaps.js.map +1 -1
- package/package.json +12 -6
- package/skills/query-logs/SKILL.md +14 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dasasian/firebase-structured-logger",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Structured logging for Firebase apps —
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Structured logging for Firebase and Google Cloud web apps — browser, backend, and tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dasasian",
|
|
7
7
|
"keywords": [
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"source-maps",
|
|
14
14
|
"symbolication",
|
|
15
15
|
"observability",
|
|
16
|
-
"typescript"
|
|
16
|
+
"typescript",
|
|
17
|
+
"google-cloud",
|
|
18
|
+
"cloud-run",
|
|
19
|
+
"error-reporting"
|
|
17
20
|
],
|
|
18
21
|
"homepage": "https://dasasian.com/firebase-structured-logger",
|
|
19
22
|
"repository": {
|
|
@@ -64,11 +67,13 @@
|
|
|
64
67
|
"build": "tsc",
|
|
65
68
|
"build:watch": "tsc --watch",
|
|
66
69
|
"clean": "rm -rf dist",
|
|
67
|
-
"typecheck": "tsc --noEmit",
|
|
68
|
-
"test": "tsx tests/logger.ts && tsx tests/breadcrumbs.ts && tsx tests/rateLimiter.ts && tsx tests/errorHandler.ts && tsx tests/attachments.ts && tsx tests/feedback.ts && tsx tests/sourceMapStripping.ts && FUNCTIONS_EMULATOR=true tsx tests/errorPayload.ts && FUNCTIONS_EMULATOR=true tsx tests/requestLogger.ts && FUNCTIONS_EMULATOR=true tsx tests/handler.ts && FUNCTIONS_EMULATOR=true tsx tests/symbolication.ts && FUNCTIONS_EMULATOR=true tsx tests/publicApi.ts && FUNCTIONS_EMULATOR=true tsx tests/configureTwice.ts && tsx tests/productionOutput.ts && tsx tests/handlerSymbolication.ts && tsx tests/releaseResolution.ts && tsx tests/sourceMapCacheBounds.ts",
|
|
70
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.check.json",
|
|
71
|
+
"test": "tsx tests/logger.ts && tsx tests/browserBundle.ts && tsx tests/breadcrumbs.ts && tsx tests/rateLimiter.ts && tsx tests/errorHandler.ts && tsx tests/attachments.ts && tsx tests/feedback.ts && tsx tests/paths.ts && tsx tests/loadsWithoutOptionalPeers.ts && tsx tests/sourceMapStripping.ts && FUNCTIONS_EMULATOR=true tsx tests/errorPayload.ts && FUNCTIONS_EMULATOR=true tsx tests/requestLogger.ts && FUNCTIONS_EMULATOR=true tsx tests/handler.ts && FUNCTIONS_EMULATOR=true tsx tests/httpHandler.ts && FUNCTIONS_EMULATOR=true tsx tests/symbolication.ts && FUNCTIONS_EMULATOR=true tsx tests/publicApi.ts && FUNCTIONS_EMULATOR=true tsx tests/configureTwice.ts && tsx tests/productionOutput.ts && tsx tests/storageChain.ts && tsx tests/handlerSymbolication.ts && tsx tests/releaseResolution.ts && tsx tests/sourceMapCacheBounds.ts",
|
|
69
72
|
"prepublishOnly": "npm run clean && npm run build",
|
|
70
73
|
"smoke:deploy": "cd smoke/functions && npm install && npm run build && cd .. && firebase deploy --only functions --project $(grep '^FSL_SMOKE_PROJECT=' .env.local | cut -d= -f2)",
|
|
71
|
-
"smoke": "
|
|
74
|
+
"smoke:deploy:run": "bash smoke/cloudrun/deploy.sh",
|
|
75
|
+
"smoke": "tsx smoke/run.ts",
|
|
76
|
+
"smoke:install": "tsx smoke/install.ts"
|
|
72
77
|
},
|
|
73
78
|
"dependencies": {
|
|
74
79
|
"@google-cloud/storage": "^7.0.0",
|
|
@@ -95,6 +100,7 @@
|
|
|
95
100
|
"@google-cloud/logging": "^11.4.0",
|
|
96
101
|
"@types/jsdom": "^30.0.0",
|
|
97
102
|
"@types/node": "^26.2.0",
|
|
103
|
+
"esbuild": "^0.28.2",
|
|
98
104
|
"firebase": "^12.0.0",
|
|
99
105
|
"firebase-admin": "^14.2.0",
|
|
100
106
|
"firebase-functions": "^7.0.0",
|
|
@@ -30,7 +30,20 @@ App-specific labels are defined in each app's `AppLabels` type.
|
|
|
30
30
|
|
|
31
31
|
## Common Queries
|
|
32
32
|
|
|
33
|
-
###
|
|
33
|
+
### Everything one user did, in order
|
|
34
|
+
```
|
|
35
|
+
labels.userId="<uid>"
|
|
36
|
+
```
|
|
37
|
+
No severity filter. Frontend and backend entries share the `userId` label, so this
|
|
38
|
+
returns both halves interleaved in time order — the clicks and screen changes that
|
|
39
|
+
led up to a failure, the backend call that failed, and the error the browser saw.
|
|
40
|
+
Filtering to `severity=ERROR` keeps the crash and throws away the story; reach for
|
|
41
|
+
it only when you already know what you are looking for.
|
|
42
|
+
|
|
43
|
+
Add `labels.platform:*` for client entries only, or `labels.functionName:*` for
|
|
44
|
+
server entries only.
|
|
45
|
+
|
|
46
|
+
### Only the errors for a user
|
|
34
47
|
```
|
|
35
48
|
labels.userId="<uid>" severity=ERROR
|
|
36
49
|
```
|