Skip to content

Commit b793f33

Browse files
mpcgridmatt-aitken
andauthored
Logs: new materialized view and some UI improvements (#3069)
This will prevent internal logs to be added to the task_events_search_table Closes #<issue> ## ✅ Checklist - [x] I have followed every step in the [contributing guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md) - [x] The PR title follows the convention. - [x] I ran and tested the code works --- ## Testing Ran the migration, deleted the old invalid rows and ran new tasks. The undesired logs are not added to the table. --- ## Changelog Updated the MATERIALIZED VIEW to also filter for `trace_id != ''` --------- Co-authored-by: Matt Aitken <matt@mattaitken.com>
1 parent 6e0b54b commit b793f33

25 files changed

+506
-772
lines changed
Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { BookOpenIcon } from "@heroicons/react/20/solid";
2-
import { LinkButton } from "./primitives/Buttons";
31
import { Header3 } from "./primitives/Headers";
42
import { Paragraph } from "./primitives/Paragraph";
3+
import { LogLevel } from "./logs/LogLevel";
54

65
export function LogLevelTooltipInfo() {
76
return (
@@ -13,51 +12,45 @@ export function LogLevelTooltipInfo() {
1312
</Paragraph>
1413
</div>
1514
<div>
16-
<div className="mb-0.5">
17-
<Header3 className="text-blue-400">Info</Header3>
15+
<div className="mb-1">
16+
<LogLevel level="TRACE" />
17+
</div>
18+
<Paragraph variant="small" className="text-text-dimmed">
19+
Traces and spans representing the execution flow of your tasks.
20+
</Paragraph>
21+
</div>
22+
<div>
23+
<div className="mb-1">
24+
<LogLevel level="INFO" />
1825
</div>
1926
<Paragraph variant="small" className="text-text-dimmed">
2027
General informational messages about task execution.
2128
</Paragraph>
2229
</div>
2330
<div>
24-
<div className="mb-0.5">
25-
<Header3 className="text-warning">Warn</Header3>
31+
<div className="mb-1">
32+
<LogLevel level="WARN" />
2633
</div>
2734
<Paragraph variant="small" className="text-text-dimmed">
2835
Warning messages indicating potential issues that don't prevent execution.
2936
</Paragraph>
3037
</div>
3138
<div>
32-
<div className="mb-0.5">
33-
<Header3 className="text-error">Error</Header3>
39+
<div className="mb-1">
40+
<LogLevel level="ERROR" />
3441
</div>
3542
<Paragraph variant="small" className="text-text-dimmed">
3643
Error messages for failures and exceptions during task execution.
3744
</Paragraph>
3845
</div>
3946
<div>
40-
<div className="mb-0.5">
41-
<Header3 className="text-charcoal-400">Debug</Header3>
47+
<div className="mb-1">
48+
<LogLevel level="DEBUG" />
4249
</div>
4350
<Paragraph variant="small" className="text-text-dimmed">
4451
Detailed diagnostic information for development and debugging.
4552
</Paragraph>
4653
</div>
47-
<div className="border-t border-charcoal-700 pt-4">
48-
<Header3>Tracing & Spans</Header3>
49-
<Paragraph variant="small" className="text-text-dimmed">
50-
Automatically track the flow of your code through task triggers, attempts, and HTTP
51-
requests. Create custom traces to monitor specific operations.
52-
</Paragraph>
53-
</div>
54-
<LinkButton
55-
to="https://trigger.dev/docs/logging#tracing-and-spans"
56-
variant="docs/small"
57-
LeadingIcon={BookOpenIcon}
58-
>
59-
Read docs
60-
</LinkButton>
6154
</div>
6255
);
6356
}

apps/webapp/app/components/code/CodeBlock.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ type CodeBlockProps = {
6868

6969
/** Search term to highlight in the code */
7070
searchTerm?: string;
71+
72+
/** Whether to wrap the code */
73+
wrap?: boolean;
7174
};
7275

7376
const dimAmount = 0.5;
@@ -207,6 +210,7 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
207210
fileName,
208211
rowTitle,
209212
searchTerm,
213+
wrap = false,
210214
...props
211215
}: CodeBlockProps,
212216
ref
@@ -215,7 +219,7 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
215219
const [copied, setCopied] = useState(false);
216220
const [modalCopied, setModalCopied] = useState(false);
217221
const [isModalOpen, setIsModalOpen] = useState(false);
218-
const [isWrapped, setIsWrapped] = useState(false);
222+
const [isWrapped, setIsWrapped] = useState(wrap);
219223

220224
const onCopied = useCallback(
221225
(event: React.MouseEvent<HTMLButtonElement>) => {

0 commit comments

Comments
 (0)