Skip to content

Commit f2e432f

Browse files
authored
fix(tracing): otel log level setup only for non-standalone processor (#600)
1 parent cf804fe commit f2e432f

File tree

1 file changed

+7
-7
lines changed
  • packages/traceloop-sdk/src/lib/configuration

1 file changed

+7
-7
lines changed

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ export const initialize = (options: InitializeOptions) => {
7171

7272
_configuration = Object.freeze(options);
7373

74-
if (options.logLevel) {
75-
diag.setLogger(
76-
new DiagConsoleLogger(),
77-
logLevelToOtelLogLevel(options.logLevel),
78-
);
79-
}
80-
8174
if (!options.silenceInitializationMessage) {
8275
console.log(
8376
`Traceloop exporting traces to ${
@@ -87,6 +80,13 @@ export const initialize = (options: InitializeOptions) => {
8780
}
8881

8982
if (options.tracingEnabled === undefined || options.tracingEnabled) {
83+
if (options.logLevel) {
84+
diag.setLogger(
85+
new DiagConsoleLogger(),
86+
logLevelToOtelLogLevel(options.logLevel),
87+
);
88+
}
89+
9090
startTracing(_configuration);
9191
}
9292

0 commit comments

Comments
 (0)