MCPcopy
hub / github.com/triggerdotdev/trigger.dev / IOLogger

Class IOLogger

packages/trigger-sdk/src/io.ts:1586–1613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1584) => Promise<void>;
1585
1586export class IOLogger implements TaskLogger {
1587 constructor(private callback: CallbackFunction) {}
1588
1589 /** Log: essential messages */
1590 log(message: string, properties?: Record<string, any>): Promise<void> {
1591 return this.callback("LOG", message, properties);
1592 }
1593
1594 /** For debugging: the least important log level */
1595 debug(message: string, properties?: Record<string, any>): Promise<void> {
1596 return this.callback("DEBUG", message, properties);
1597 }
1598
1599 /** Info: the second least important log level */
1600 info(message: string, properties?: Record<string, any>): Promise<void> {
1601 return this.callback("INFO", message, properties);
1602 }
1603
1604 /** Warnings: the third most important log level */
1605 warn(message: string, properties?: Record<string, any>): Promise<void> {
1606 return this.callback("WARN", message, properties);
1607 }
1608
1609 /** Error: The second most important log level */
1610 error(message: string, properties?: Record<string, any>): Promise<void> {
1611 return this.callback("ERROR", message, properties);
1612 }
1613}
1614
1615// Space out the execution of the callback by a delay of index * delay
1616async function spaceOut<T>(callback: () => Promise<T>, index: number, delay: number): Promise<T> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…