Skip to content

Commit

Permalink
fix(sdk): option to silence initialization message (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
chitalian authored Jul 3, 2024
1 parent 3b8224f commit 75c68ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
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;
}

0 comments on commit 75c68ce

Please sign in to comment.