roarr
Advanced tools
Comparing version 7.21.0 to 7.21.1
@@ -9,3 +9,3 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
const utilities_1 = require("../utilities"); | ||
const hasOwnProperty_1 = require("../utilities/hasOwnProperty"); | ||
const isBrowser_1 = require("../utilities/isBrowser"); | ||
@@ -43,4 +43,4 @@ const isTruthy_1 = require("../utilities/isTruthy"); | ||
const asyncLocalContext = getAsyncLocalContext(); | ||
if ((0, utilities_1.hasOwnProperty)(asyncLocalContext, 'sequenceRoot') && | ||
(0, utilities_1.hasOwnProperty)(asyncLocalContext, 'sequence') && | ||
if ((0, hasOwnProperty_1.hasOwnProperty)(asyncLocalContext, 'sequenceRoot') && | ||
(0, hasOwnProperty_1.hasOwnProperty)(asyncLocalContext, 'sequence') && | ||
typeof asyncLocalContext.sequence === 'number') { | ||
@@ -222,4 +222,4 @@ return (String(asyncLocalContext.sequenceRoot) + | ||
let sequenceRoot; | ||
if ((0, utilities_1.hasOwnProperty)(asyncLocalContext, 'sequenceRoot') && | ||
(0, utilities_1.hasOwnProperty)(asyncLocalContext, 'sequence') && | ||
if ((0, hasOwnProperty_1.hasOwnProperty)(asyncLocalContext, 'sequenceRoot') && | ||
(0, hasOwnProperty_1.hasOwnProperty)(asyncLocalContext, 'sequence') && | ||
typeof asyncLocalContext.sequence === 'number') { | ||
@@ -226,0 +226,0 @@ sequenceRoot = |
@@ -14,3 +14,3 @@ "use strict"; | ||
// but we may want to make these configurable in the future. | ||
maximumBreadth: 10, | ||
maximumBreadth: 20, | ||
maximumDepth: 10, | ||
@@ -17,0 +17,0 @@ strict: false, |
@@ -15,3 +15,3 @@ { | ||
"nodeArguments": [ | ||
"--loader=tsx" | ||
"--import=tsimp" | ||
] | ||
@@ -33,3 +33,3 @@ }, | ||
"@types/semver-compare": "^1.0.2", | ||
"ava": "^5.3.1", | ||
"ava": "^6.1.2", | ||
"benchmark": "^2.1.4", | ||
@@ -43,4 +43,5 @@ "eslint": "^8.52.0", | ||
"sinon": "^17.0.0", | ||
"tsx": "^3.14.0", | ||
"typescript": "^5.2.2" | ||
"tsimp": "^2.0.11", | ||
"tsx": "^4.7.1", | ||
"typescript": "^5.4.2" | ||
}, | ||
@@ -71,6 +72,6 @@ "engines": { | ||
"lint": "eslint ./src ./test && tsc && knip", | ||
"test": "NODE_ENV=test ava --serial --verbose" | ||
"test": "ava --serial --verbose" | ||
}, | ||
"types": "./dist/Roarr.d.ts", | ||
"version": "7.21.0" | ||
"version": "7.21.1" | ||
} |
@@ -579,3 +579,3 @@ # Roarr | ||
import type { | ||
MessageEventHandler, | ||
MessageSerializer, | ||
} from 'roarr'; | ||
@@ -585,3 +585,3 @@ | ||
const serializeMessage: MessageEventHandler = (message) => { | ||
const serializeMessage: MessageSerializer = (message) => { | ||
return JSON.stringify(message); | ||
@@ -761,2 +761,14 @@ }; | ||
## Context Truncation | ||
Roarr by default truncates context properties if the context object is wider or deeper than 10 properties. At the moment, this is a hard-coded value. Waiting for feedback on whether this is a reasonable default and if it needs to be configurable. | ||
When the context goes over this limit, you will start seeing `...` entries in your logs, e.g. | ||
```json | ||
{"a":"a","b":"b","c":"c","d":"d","e":"e","f":"f","g":"g","h":"h","i":"i","j":"j","...":"1 item not stringified"} | ||
``` | ||
The reason for this is to prevent accidental logging of massive objects that can cause context truncation and performance issues. | ||
## Developing | ||
@@ -763,0 +775,0 @@ |
@@ -12,3 +12,3 @@ import { ROARR_LOG_FORMAT_VERSION } from '../config'; | ||
} from '../types'; | ||
import { hasOwnProperty } from '../utilities'; | ||
import { hasOwnProperty } from '../utilities/hasOwnProperty'; | ||
import { isBrowser } from '../utilities/isBrowser'; | ||
@@ -15,0 +15,0 @@ import { isTruthy } from '../utilities/isTruthy'; |
@@ -12,3 +12,3 @@ import { configure } from 'safe-stable-stringify'; | ||
// but we may want to make these configurable in the future. | ||
maximumBreadth: 10, | ||
maximumBreadth: 20, | ||
maximumDepth: 10, | ||
@@ -15,0 +15,0 @@ strict: false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
98867
776
18
79
1325