| 1584 | ) => Promise<void>; |
| 1585 | |
| 1586 | export 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 |
| 1616 | async function spaceOut<T>(callback: () => Promise<T>, index: number, delay: number): Promise<T> { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…