Skip to content

Commit 7ea8803

Browse files
authored
add basic logging middleware (#135)
## Motivation We need more visibility as to what is going on in simulators like auth0 which are annoying to debug. ## Approach There is a basic middleware component in `@simulacrum/server` that simulators can use to log HTTP requests. It can take 1 or more logging function. I've add one logging function to auth0 that writes to the affection inspector: ```ts app: createHttpApp() .use(createLoggingMiddleware(function * (message) { yield label({ name: 'auth0-logging-middleware', log: message }); })) ``` It should be easy to add other loggers like `console.log` for quicker debugging.
1 parent c5a3bf3 commit 7ea8803

File tree

14 files changed

+152
-420
lines changed

14 files changed

+152
-420
lines changed

.changes/logging-middleware.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@simulacrum/server": minor
3+
---
4+
Add basic logging middleware component.

0 commit comments

Comments
 (0)