Skip to content

Commit 066e166

Browse files
committed
Better trace icon, with fallback to a passed in one
1 parent 036a414 commit 066e166

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/core/src/v3/logger/taskLogger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class OtelTaskLogger implements TaskLogger {
9999
...options,
100100
attributes: {
101101
...options?.attributes,
102-
...(options?.icon ? { [SemanticInternalAttributes.STYLE_ICON]: options.icon } : {}),
102+
[SemanticInternalAttributes.STYLE_ICON]: options?.icon ?? "trace",
103103
},
104104
};
105105

references/hello-world/src/trigger/example.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ export const helloWorldTask = task({
1212
logger.warn("warn: Hello, world!", { payload });
1313
logger.error("error: Hello, world!", { payload });
1414

15+
logger.trace("my trace", async (span) => {
16+
logger.debug("some log", { span });
17+
});
18+
19+
logger.trace(
20+
"my trace",
21+
async (span) => {
22+
logger.debug("some log", { span });
23+
},
24+
{
25+
icon: "tabler-ad-circle",
26+
}
27+
);
28+
1529
await wait.for({ seconds: 5 });
1630

1731
return {

0 commit comments

Comments
 (0)