Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit e73af2b

Browse files
authored
fix: swap log levels for two log points (#882)
1 parent c2b9349 commit e73af2b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/trace-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class StackdriverTracer implements Tracer {
238238
// with continuously growing number of child spans. The second case
239239
// seems to have some value, but isn't representable. The user probably
240240
// needs a custom outer span that encompasses the entirety of work.
241-
this.logger!.error(`TraceApi#createChildSpan: [${
241+
this.logger!.warn(`TraceApi#createChildSpan: [${
242242
this.pluginName}] Creating phantom child span [${
243243
options.name}] because root span [${
244244
rootSpan.span.name}] was already closed.`);
@@ -270,7 +270,7 @@ export class StackdriverTracer implements Tracer {
270270
// RootSpanData instance, this block might be skipped because it only
271271
// checks equality -- this is OK because no automatic tracing plugin
272272
// uses the RootSpanData API directly.
273-
this.logger!.warn(`TraceApi#createChildSpan: [${
273+
this.logger!.error(`TraceApi#createChildSpan: [${
274274
this.pluginName}] Adding child span [${
275275
options.name}] will cause the trace with root span [${
276276
rootSpan.span.name}] to contain more than ${

test/test-trace-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ describe('Trace Interface', () => {
157157
});
158158
});
159159

160-
it('should warn when the spans per trace soft limit has been exceeded',
160+
it('should error when the spans per trace soft limit has been exceeded',
161161
() => {
162162
const tracer = createTraceAgent(
163163
null, {spansPerTraceSoftLimit: 10, spansPerTraceHardLimit: 20});
164164
tracer.runInRootSpan({name: 'root'}, (rootSpan) => {
165165
for (let i = 0; i < 10; i++) {
166166
tracer.createChildSpan({name: `span-${i}`}).endSpan();
167167
}
168-
assert.strictEqual(logger.getNumLogsWith('warn', '[span-9]'), 1);
168+
assert.strictEqual(logger.getNumLogsWith('error', '[span-9]'), 1);
169169
for (let i = 0; i < 9; i++) {
170170
tracer.createChildSpan({name: `span-${i + 10}`}).endSpan();
171171
}

0 commit comments

Comments
 (0)