Skip to content

Commit cd53797

Browse files
authored
Merge pull request #12 from lad-tech/11-transfer-logs-formatter-to-client-from-service
11 transfer logs formatter to client from service
2 parents 508da2c + 7c71c53 commit cd53797

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lad-tech/nsc-toolkit",
3-
"version": "0.6.2",
3+
"version": "0.7.0",
44
"description": "Toolkit for create microservices around NATS",
55
"main": "dist/index.js",
66
"types": "./dist/types/index.d.ts",

src/Client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { EventEmitter, Readable } from 'stream';
1616
import * as http from 'http';
1717
import { createHash } from 'crypto';
1818
import { setTimeout } from 'timers/promises';
19+
import type { Logs } from '@lad-tech/toolbelt';
1920
import Ajv from 'ajv';
2021

2122
export class Client<E extends Emitter = {}> extends Root {
@@ -27,8 +28,9 @@ export class Client<E extends Emitter = {}> extends Root {
2728
private serviceName: string,
2829
private baggage?: Baggage,
2930
private cache?: CacheSettings,
31+
loggerOutputFormatter?: Logs.OutputFormatter
3032
) {
31-
super(natsConnection);
33+
super(natsConnection, loggerOutputFormatter);
3234
this.logger.setLocation(serviceName);
3335
}
3436

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type ClientService<C = Client> = new (
3333
natsConnection: NatsConnection,
3434
baggage?: Baggage,
3535
cache?: CacheSettings,
36+
loggerOutputFormatter?: Logs.OutputFormatter,
3637
) => C;
3738

3839
export type Baggage = {

0 commit comments

Comments
 (0)