Skip to content

Commit dee6dc9

Browse files
committed
silence initialization message
1 parent 3b8224f commit dee6dc9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

packages/traceloop-sdk/src/lib/configuration/index.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ export const initialize = (options: InitializeOptions) => {
7070
logLevelToOtelLogLevel(options.logLevel),
7171
);
7272
}
73-
console.log(
74-
`Traceloop exporting traces to ${
75-
_configuration.exporter ? "a custom exporter" : _configuration.baseUrl
76-
}`,
77-
);
73+
74+
if (!options.silenceInitializationMessage) {
75+
console.log(
76+
`Traceloop exporting traces to ${
77+
_configuration.exporter ? "a custom exporter" : _configuration.baseUrl
78+
}`,
79+
);
80+
}
7881

7982
startTracing(_configuration);
8083
initializeRegistry(_configuration);

packages/traceloop-sdk/src/lib/interfaces/initialize-options.interface.ts

+6
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,10 @@ export interface InitializeOptions {
113113
* Defaults to TRACELOOP_SYNC_DEV_POLLING_INTERVAL environment variable or 5 if not set.
114114
*/
115115
traceloopSyncDevPollingInterval?: number;
116+
117+
/**
118+
* Whether to silence the initialization message. Optional.
119+
* Defaults to false.
120+
*/
121+
silenceInitializationMessage?: boolean;
116122
}

0 commit comments

Comments
 (0)