Skip to content

Commit

Permalink
Merge pull request #442 from senacor/bugfix/logging_limitations
Browse files Browse the repository at this point in the history
Fix logging limitations
  • Loading branch information
ziegler-daniel authored Nov 18, 2024
2 parents ff606ad + a5d500c commit 6c6fee2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 3.1.1 (15.11.2024)
* Do not limit array length, object depth or string length for logging

## 3.1.0 (11.10.2024)
* Switched to `inspect` from `node:util` to stringify values for logging
* Changed `debug` and `trace` logs to severity level verbose
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@senacor/azure-function-middleware",
"version": "3.1.0",
"version": "3.1.1",
"description": "Middleware for azure functions to handle authentication, authorization, error handling and logging",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/util/stringify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ describe('stringify should', () => {
it('join multiple arguments with spaces', () => {
expect(stringify('Test', 2, { message: 'World' })).toBe("Test 2 { message: 'World' }");
});

it('print all array items', () => {
expect(stringify(Array(250).fill(1)).match(/1/g)?.length).toBe(250);
});
});
2 changes: 1 addition & 1 deletion src/util/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ function stringifyValue(value: unknown): string {
return value;
}

return inspect(value);
return inspect(value, { depth: null, maxArrayLength: null, maxStringLength: null });
}

0 comments on commit 6c6fee2

Please sign in to comment.