Skip to content

Commit 3d1d89f

Browse files
Ashish AggarwalAshish Aggarwal
authored andcommitted
Adding callback for closing the tracer
1 parent bed15cf commit 3d1d89f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class Configuration {
3333
case 'in_memory':
3434
return new InMemoryDispatcher();
3535
default:
36-
throw new Error(`reporter of type ${dispatcher} is not unknown`);
36+
throw new Error(`dispatcher of type ${dispatcher} is not unknown`);
3737
}
3838
}
3939
return new NoopDispatcher();

src/tracer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,14 @@ export default class Tracer {
112112
return this._dispatcher;
113113
}
114114

115-
close(): void {
115+
close(callback: () => void): void {
116116
this._dispatcher.close(() => {
117117
if (this._logger) {
118118
this._logger.info('Tracer has been closed now.');
119119
}
120+
if (callback) {
121+
callback();
122+
}
120123
});
121124
}
122125

0 commit comments

Comments
 (0)