Skip to content

Commit f1ba27f

Browse files
committed
Run skuba format
1 parent 47d5cf3 commit f1ba27f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.changeset/olive-worms-run.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
template/koa-rest-api: Use [AsyncLocalStorage](https://nodejs.org/docs/latest-v16.x/api/async_context.html#asynchronous-context-tracking) to track logger context
66

7-
87
We now employ [RequestLogging.createContextStorage](https://github.com/seek-oss/koala/blob/master/src/requestLogging/README.md#context-logging) to thread logging context through the middleware stack of your Koa application. This enables use of a singleton `logger` instance instead of manually propagating Koa context and juggling `rootLogger`s and `contextLogger`s.
98

109
Before:
10+
1111
```typescript
1212
import createLogger from '@seek/logger';
1313
import Koa from 'koa';
@@ -20,7 +20,9 @@ const app = new Koa().use((ctx) => {
2020
contextLogger(ctx).info('Has context');
2121
});
2222
```
23+
2324
After:
25+
2426
```typescript
2527
import createLogger from '@seek/logger';
2628
import Koa from 'koa';
@@ -32,4 +34,4 @@ const logger = createLogger({ mixin });
3234
const app = new Koa().use(contextMiddleware).use((ctx) => {
3335
logger.info('Has context');
3436
});
35-
```
37+
```

0 commit comments

Comments
 (0)