Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(sdk): option to silence initialization message #343

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/traceloop-sdk/src/lib/configuration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ export const initialize = (options: InitializeOptions) => {
logLevelToOtelLogLevel(options.logLevel),
);
}
console.log(
`Traceloop exporting traces to ${
_configuration.exporter ? "a custom exporter" : _configuration.baseUrl
}`,
);

if (!options.silenceInitializationMessage) {
console.log(
`Traceloop exporting traces to ${
_configuration.exporter ? "a custom exporter" : _configuration.baseUrl
}`,
);
}

startTracing(_configuration);
initializeRegistry(_configuration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,10 @@ export interface InitializeOptions {
* Defaults to TRACELOOP_SYNC_DEV_POLLING_INTERVAL environment variable or 5 if not set.
*/
traceloopSyncDevPollingInterval?: number;

/**
* Whether to silence the initialization message. Optional.
* Defaults to false.
*/
silenceInitializationMessage?: boolean;
}
Loading