Skip to content

Commit c615bb4

Browse files
add runtime logger
1 parent cb50896 commit c615bb4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/test/src/test-runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ if (RUN_INTEGRATION_TESTS) {
5555
// Runtime configuration was installed, creating a new Worker after Runtime shutdown we would fallback
5656
// to the default configuration (127.0.0.1) which is surprising behavior.
5757
test.serial('Runtime.install() remembers installed options after it has been shut down', async (t) => {
58-
const logger = new DefaultLogger('DEBUG');
59-
Runtime.install({ logger });
58+
const logger = new DefaultLogger('TRACE');
59+
Runtime.install({ logger, telemetryOptions: { logging: { filter: { core: 'TRACE' } } } });
6060
{
6161
const runtime = Runtime.instance();
6262
t.is(runtime.options.logger, logger);

packages/test/src/test-worker-lifecycle.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { setTimeout } from 'timers/promises';
88
import { randomUUID } from 'crypto';
99
import test from 'ava';
10-
import { Runtime, PromiseCompletionTimeoutError } from '@temporalio/worker';
10+
import { Runtime, PromiseCompletionTimeoutError, makeTelemetryFilterString, DefaultLogger } from '@temporalio/worker';
1111
import { TransportError, UnexpectedError } from '@temporalio/worker/lib/errors';
1212
import { Client } from '@temporalio/client';
1313
import { RUN_INTEGRATION_TESTS, Worker } from './helpers';
@@ -35,6 +35,12 @@ if (RUN_INTEGRATION_TESTS) {
3535
});
3636

3737
test.serial("Worker.runUntil doesn't hang if provided promise survives to Worker's shutdown", async (t) => {
38+
const logger = new DefaultLogger('TRACE');
39+
t.is(Runtime._instance, undefined);
40+
Runtime.install({
41+
telemetryOptions: { tracingFilter: makeTelemetryFilterString({ core: 'TRACE' }) },
42+
logger,
43+
});
3844
const worker = await Worker.create({
3945
...defaultOptions,
4046
taskQueue: t.title.replace(/ /g, '_'),

0 commit comments

Comments
 (0)