File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
packages/cli-v3/src/entryPoints/managed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 88} from "@trigger.dev/core/v3/workers" ;
99import { io , type Socket } from "socket.io-client" ;
1010import { RunnerEnv } from "./env.js" ;
11- import { RunLogger , SendDebugLogOptions } from "./logger.js" ;
11+ import { ManagedRunLogger , RunLogger , SendDebugLogOptions } from "./logger.js" ;
1212import { EnvObject } from "std-env" ;
1313import { RunExecution } from "./execution.js" ;
1414import { tryCatch } from "@trigger.dev/core/utils" ;
@@ -47,7 +47,7 @@ export class ManagedRunController {
4747 projectRef : env . TRIGGER_PROJECT_REF ,
4848 } ) ;
4949
50- this . logger = new RunLogger ( {
50+ this . logger = new ManagedRunLogger ( {
5151 httpClient : this . httpClient ,
5252 env,
5353 } ) ;
Original file line number Diff line number Diff line change @@ -14,16 +14,20 @@ export type SendDebugLogOptions = {
1414 print ?: boolean ;
1515} ;
1616
17+ export interface RunLogger {
18+ sendDebugLog ( options : SendDebugLogOptions ) : void ;
19+ }
20+
1721export type RunLoggerOptions = {
1822 httpClient : WorkloadHttpClient ;
1923 env : RunnerEnv ;
2024} ;
2125
22- export class RunLogger {
26+ export class ManagedRunLogger implements RunLogger {
2327 private readonly httpClient : WorkloadHttpClient ;
2428 private readonly env : RunnerEnv ;
2529
26- constructor ( private readonly opts : RunLoggerOptions ) {
30+ constructor ( opts : RunLoggerOptions ) {
2731 this . httpClient = opts . httpClient ;
2832 this . env = opts . env ;
2933 }
@@ -59,3 +63,17 @@ export class RunLogger {
5963 } ) ;
6064 }
6165}
66+
67+ export class ConsoleRunLogger implements RunLogger {
68+ private readonly print : boolean ;
69+
70+ constructor ( opts : { print ?: boolean } = { } ) {
71+ this . print = opts . print ?? true ;
72+ }
73+
74+ sendDebugLog ( { message, properties } : SendDebugLogOptions ) : void {
75+ if ( this . print ) {
76+ console . log ( "[ConsoleLogger]" , message , properties ) ;
77+ }
78+ }
79+ }
Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ export class SnapshotManager {
7575 return this . enqueueSnapshotChange ( { type : "suspendable" , value : suspendable } ) ;
7676 }
7777
78+ /**
79+ * Update the snapshot ID and status without invoking any handlers
80+ *
81+ * @param snapshotId - The ID of the snapshot to update to
82+ * @param status - The status to update to
83+ */
7884 public updateSnapshot ( snapshotId : string , status : TaskRunExecutionStatus ) {
7985 // Check if this is an old snapshot
8086 if ( snapshotId < this . state . id ) {
You can’t perform that action at this time.
0 commit comments